Пример #1
0
        static bool CreateService(IList<string> unparsed)
        {
            if (unparsed.Count != 2)
            {
                Console.Error.WriteLine("Usage: vmc create-service <service> <servicename>"); // TODO usage statement standardization
                return false;
            }

            string svc     = unparsed[0];
            string svcname = unparsed[1];

            IVcapClient vc = new VcapClient();
            VcapClientResult rslt = vc.CreateService(svc, svcname);
            return rslt.Success;
        }
Пример #2
0
        static bool CreateService(IList <string> unparsed)
        {
            if (unparsed.Count != 2)
            {
                Console.Error.WriteLine("Usage: vmc create-service <service> <servicename>");
                return(false);
            }

            string svc     = unparsed[0];
            string svcname = unparsed[1];

            IVcapClient      vc   = new VcapClient();
            VcapClientResult rslt = vc.CreateService(svc, svcname);

            return(rslt.Success);
        }
Пример #3
0
        public ProviderResponse <bool> CreateService(Cloud cloud, string serviceName, string provisionedServiceName)
        {
            var response = new ProviderResponse <bool>();

            try
            {
                IVcapClient client = new VcapClient(cloud);
                client.CreateService(serviceName, provisionedServiceName);
                response.Response = true;
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;
            }
            return(response);
        }
Пример #4
0
        public ProviderResponse <bool> CreateService(Cloud cloud, string serviceName, string provisionedServiceName)
        {
            ProviderResponse <bool> response = new ProviderResponse <bool>();

            try
            {
                IVcapClient client     = new VcapClient(cloud);
                var         vcapResult = client.CreateService(serviceName, provisionedServiceName);
                if (!vcapResult.Success)
                {
                    throw new Exception(vcapResult.Message);
                }
                response.Response = true;
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;
            }
            return(response);
        }
 public ProviderResponse<bool> CreateService(Cloud cloud, string serviceName, string provisionedServiceName)
 {
     var response = new ProviderResponse<bool>();
     try
     {
         IVcapClient client = new VcapClient(cloud);
         client.CreateService(serviceName, provisionedServiceName);
         response.Response = true;
     }
     catch (Exception ex)
     {
         response.Message = ex.Message;
     }
     return response;
 }