Esempio n. 1
0
        static void Main1(string[] args)
        {
            const string ak = "{your ak string}";
            const string sk = "{your sk string}";
            //for example endpoint = "https://ecs.XXXXXX.myhuaweicloud.com"
            const string endpoint  = "{your endpoint string}";
            const string projectId = "{your projectID string}";

            var config = HttpConfig.GetDefaultConfig();

            config.IgnoreSslVerification = true;
            var auth      = new BasicCredentials(ak, sk, projectId);
            var ecsClient = EcsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            CreatePostPaidServers(ecsClient);
            ShowServer(ecsClient);
            ListServersDetails(ecsClient);
            UpdateServer(ecsClient);
            ResizePostPaidServer(ecsClient);
            DeleteServers(ecsClient);
            BatchStopServers(ecsClient);
            BatchStartServers(ecsClient);
            BatchRebootServers(ecsClient);
        }
        static void Main1(string[] args)
        {
            const string ak = "{your ak string}";
            const string sk = "{your sk string}";
            //for example endpoint = "https://ecs.XXXXXX.myhuaweicloud.com"
            const string endpoint  = "{your endpoint string}";
            const string projectId = "{your projectID string}";

            var config = HttpConfig.GetDefaultConfig();

            config.IgnoreSslVerification = true;
            var auth      = new BasicCredentials(ak, sk, projectId);
            var ecsClient = EcsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            ListServerInterfaces(ecsClient);
        }