コード例 #1
0
ファイル: Services.cs プロジェクト: ademar/ironfoundry
        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
ファイル: Services.cs プロジェクト: chandermani/ironfoundry
        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);
        }
コード例 #5
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;
 }