Exemple #1
0
        public UploadUserDataAttachmentOutput UploadUserDataAttachment(UploadUserDataAttachmentInput input)
        {
            Dictionary <object, object> context = new Dictionary <object, object>();

            context.Add(Constant.PARAM_KEY_REQUEST_ZONE, this.zone);
            context.Add(Constant.CONFIG_CONTEXT_KEY, this.Config);
            context.Add("action", "DescribeInstances");
            context.Add("APIName", "DescribeInstances");
            context.Add("ServiceName", "Describe Instances");
            context.Add("RequestMethod", "POST");
            //context.Add("RequestURI", "/<>");
            //context.Add("instanceNameInput", this.instanceName);

            if (StringUtil.isEmpty(zone))
            {
                throw new QCException("zone can't be empty!");
            }

            OutputModel backModel =
                ResourceRequestFactory.getResourceRequest()
                .sendApiRequest(context, input, typeof(UploadUserDataAttachmentOutput));

            if (backModel != null)
            {
                return((UploadUserDataAttachmentOutput)backModel);
            }
            return(null);
        }
Exemple #2
0
        /*
         *
         * @param input
         * @param callback
         * @
         *
         * Documentation URL: https://docs.qingcloud.com/qingstor/api/service/get.html
         */

        public void listBucketsAsync(
            ListBucketsInput input, ResponseCallBack callback)
        {
            if (input == null)
            {
                input = new ListBucketsInput();
            }

            Dictionary <object, object> context = new Dictionary <object, object>();

            context.Add(QSConstant.PARAM_KEY_REQUEST_ZONE, this.zone);
            context.Add(QSConstant.EVN_CONTEXT_KEY, this.evnContext);
            context.Add("OperationName", "ListBuckets");
            context.Add("APIName", "ListBuckets");
            context.Add("ServiceName", "Get Service");
            context.Add("RequestMethod", "GET");
            context.Add("RequestURI", "/");
            context.Add("bucketNameInput", this.bucketName);

            if (callback == null)
            {
                throw new QSException("callback can't be null");
            }

            ResourceRequestFactory.getResourceRequest().sendApiRequestAsync(context, input, callback);
        }
Exemple #3
0
        public ModifyVolumeAttributesOutput ResizeVolumes(ModifyVolumeAttributesInput input)
        {
            Dictionary <object, object> context = new Dictionary <object, object>();

            context.Add(Constant.PARAM_KEY_REQUEST_ZONE, this.zone);
            context.Add(Constant.CONFIG_CONTEXT_KEY, this.Config);
            context.Add("action", "ModifyVolumeAttributes");
            context.Add("APIName", "ModifyVolumeAttributes");
            context.Add("ServiceName", "Modify Volume Attributes");
            context.Add("RequestMethod", "GET");
            //context.Add("RequestURI", "/<>");
            //context.Add("instanceNameInput", this.instanceName);

            if (StringUtil.isEmpty(zone))
            {
                throw new QCException("zone can't be empty!");
            }

            OutputModel backModel =
                ResourceRequestFactory.getResourceRequest()
                .sendApiRequest(context, input, typeof(ModifyVolumeAttributesOutput));

            if (backModel != null)
            {
                return((ModifyVolumeAttributesOutput)backModel);
            }
            return(null);
        }
Exemple #4
0
        /*
         *
         * @param input
         * @
         *
         * Documentation URL: https://docs.qingcloud.com/qingstor/api/service/get.html
         */

        public ListBucketsOutput listBuckets(ListBucketsInput input)
        {
            if (input == null)
            {
                input = new ListBucketsInput();
            }

            Dictionary <object, object> context = new Dictionary <object, object>();

            context.Add(QSConstant.PARAM_KEY_REQUEST_ZONE, this.zone);
            context.Add(QSConstant.EVN_CONTEXT_KEY, this.evnContext);
            context.Add("OperationName", "ListBuckets");
            context.Add("APIName", "ListBuckets");
            context.Add("ServiceName", "Get Service");
            context.Add("RequestMethod", "GET");
            context.Add("RequestURI", "/");
            context.Add("bucketNameInput", this.bucketName);

            OutputModel backModel =
                ResourceRequestFactory.getResourceRequest()
                .sendApiRequest(context, input, typeof(ListBucketsOutput));

            if (backModel != null)
            {
                return((ListBucketsOutput)backModel);
            }
            return(null);
        }
Exemple #5
0
        public CaptureInstanceOutput CaptureInstance(CaptureInstanceInput input)
        {
            Dictionary <object, object> context = new Dictionary <object, object>();

            context.Add(Constant.PARAM_KEY_REQUEST_ZONE, this.zone);
            context.Add(Constant.CONFIG_CONTEXT_KEY, this.Config);
            context.Add("action", "CaptureInstance");
            context.Add("APIName", "CaptureInstance");
            context.Add("ServiceName", "Capture Instance");
            context.Add("RequestMethod", "GET");

            if (StringUtil.isEmpty(zone))
            {
                throw new QCException("zone can't be empty!");
            }

            OutputModel backModel =
                ResourceRequestFactory.getResourceRequest()
                .sendApiRequest(context, input, typeof(CaptureInstanceOutput));

            if (backModel != null)
            {
                return((CaptureInstanceOutput)backModel);
            }
            return(null);
        }