Пример #1
0
        /// <summary>
        /// 注册镜像
        /// </summary>
        public RegisterImageResponse RegisterImage(RegisterImageRequest registerImageRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("image_id", registerImageRequest.ImageId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v1/cloudimages/{image_id}/upload", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", registerImageRequest);
            HttpResponseMessage response = DoHttpRequestSync("PUT", request);

            return(JsonUtils.DeSerialize <RegisterImageResponse>(response));
        }
Пример #2
0
 /// <summary>
 /// Register Image
 /// </summary>
 /// <param name="request">Register Image  request</param>
 /// <returns>Register Image  Response from the service</returns>
 /// <remarks>
 /// The RegisterImage operation registers an AMI with Amazon EC2. Images must be
 /// registered before they can be launched. For more information, see RunInstances.
 /// Each AMI is associated with an unique ID which is provided by the Amazon EC2
 /// service through the RegisterImage operation. During registration, Amazon EC2
 /// retrieves the specified image manifest from Amazon S3 and verifies that the
 /// image is owned by the user registering the image.
 /// The image manifest is retrieved once and stored within the Amazon EC2. Any
 /// modifications to an image in Amazon S3 invalidates this registration. If you
 /// make changes to an image, deregister the previous image and register the new
 /// image. For more information, see DeregisterImage.
 ///
 /// </remarks>
 public RegisterImageResponse RegisterImage(RegisterImageRequest request)
 {
     return(Invoke <RegisterImageResponse>("RegisterImageResponse.xml"));
 }