Пример #1
0
        static void Main1(string[] args)
        {
            const string ak        = "{your ak string}";
            const string sk        = "{your sk string}";
            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 imsClient = ImsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            CreateImageByInstance(imsClient);
            CreateImageByFile(imsClient);
            ExportImage(imsClient);
            CreateDataImage(imsClient);
            CreateWholeImage(imsClient);
            ImportImageQuick(imsClient);
            ListImages(imsClient);
            UpdateImage(imsClient);

            GlanceShowImage(imsClient);
            GlanceUpdateImage(imsClient);
            GlanceDeleteImage(imsClient);
            GlanceCreateImageMetadata(imsClient);
        }
Пример #2
0
        static void Main1(string[] args)
        {
            const string ak        = "{your ak string}";
            const string sk        = "{your sk string}";
            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 imsClient = ImsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            ListOsVersions(imsClient);
        }
        static void Main1(string[] args)
        {
            const string ak        = "{your ak string}";
            const string sk        = "{your sk string}";
            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 imsClient = ImsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            BatchAddMembers(imsClient);
            BatchUpdateImageMembers(imsClient);
            //GlanceAddImageMember(imsClient);
            //GlanceUpdateImageMember(imsClient);
            //GlanceListImageMembers(imsClient);
            //GlanceShowImageMember(imsClient);
            //GlanceDeleteImageMember(imsClient);
        }