public void with_a_standard_default_application()
        {
            cloudActive = new VcapClient(TestAccountInformation.GoodUri.ToString());
            cloudActive.Login(
                TestAccountInformation.Username,
                TestAccountInformation.Password);

            var currentDirectory = Directory.GetCurrentDirectory();
            var pathToTestApp = new DirectoryInfo(currentDirectory + TestAccountInformation.TestAppToPush);

            cloudActive.Push(TestAccountInformation.TestApplicationName, TestAccountInformation.HttpIntegrationTestApiIronfoundryMe, 1,
                pathToTestApp, 64, null);
            testApplication = cloudActive.GetApplication(TestAccountInformation.TestApplicationName);
        }
Beispiel #2
0
        public ProviderResponse <bool> Push(Cloud cloud, string name, string url, ushort instances, string directoryToPushFrom, uint memory, string[] services)
        {
            var response = new ProviderResponse <bool>();

            try
            {
                IVcapClient client = new VcapClient(cloud);
                client.Push(name, url, instances, new System.IO.DirectoryInfo(directoryToPushFrom), memory, services);
                response.Response = true;
            }
            catch (Exception ex)
            {
                response.Response = false;
                response.Message  = ex.Message;
            }
            return(response);
        }
Beispiel #3
0
        static bool Push(IList <string> unparsed)
        {
            // TODO match ruby argument parsing
            if (unparsed.Count < 3 || unparsed.Count > 4)
            {
                Console.Error.WriteLine("Usage: vmc push <appname> <path> <url> [service] --instances N --mem MB"); // TODO usage statement standardization
                return(false);
            }

            string appname = unparsed[0];
            string path    = unparsed[1];
            string fqdn    = unparsed[2];

            string[] serviceNames = null;
            if (unparsed.Count == 4)
            {
                serviceNames = new[] { unparsed[3] };
            }

            DirectoryInfo di = null;

            if (Directory.Exists(path))
            {
                di = new DirectoryInfo(path);
            }
            else
            {
                Console.Error.WriteLine(String.Format("Directory '{0}' does not exist."));
                return(false);
            }

            IVcapClient      vc = new VcapClient();
            VcapClientResult rv = vc.Push(appname, fqdn, instances, di, memoryMB, serviceNames);

            if (false == rv.Success)
            {
                Console.Error.WriteLine(rv.Message);
            }
            return(rv.Success);
        }
 public ProviderResponse<bool> Push(Cloud cloud, string name, string url, ushort instances, string directoryToPushFrom, uint memory, string[] services)
 {
     var response = new ProviderResponse<bool>();
     try
     {
         IVcapClient client = new VcapClient(cloud);
         client.Push(name, url, instances, new System.IO.DirectoryInfo(directoryToPushFrom), memory, services);
         response.Response = true;
     }
     catch (Exception ex)
     {
         response.Response = false;
         response.Message = ex.Message;
     }
     return response;
 }