コード例 #1
0
        internal virtual UpdateFileSystemResponse UpdateFileSystem(UpdateFileSystemRequest request)
        {
            var marshaller   = UpdateFileSystemRequestMarshaller.Instance;
            var unmarshaller = UpdateFileSystemResponseUnmarshaller.Instance;

            return(Invoke <UpdateFileSystemRequest, UpdateFileSystemResponse>(request, marshaller, unmarshaller));
        }
コード例 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateFileSystem operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the UpdateFileSystem operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/UpdateFileSystem">REST API Reference for UpdateFileSystem Operation</seealso>
        public virtual Task <UpdateFileSystemResponse> UpdateFileSystemAsync(UpdateFileSystemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = UpdateFileSystemRequestMarshaller.Instance;
            var unmarshaller = UpdateFileSystemResponseUnmarshaller.Instance;

            return(InvokeAsync <UpdateFileSystemRequest, UpdateFileSystemResponse>(request, marshaller,
                                                                                   unmarshaller, cancellationToken));
        }
コード例 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateFileSystem operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the UpdateFileSystem operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/UpdateFileSystem">REST API Reference for UpdateFileSystem Operation</seealso>
        public virtual Task <UpdateFileSystemResponse> UpdateFileSystemAsync(UpdateFileSystemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UpdateFileSystemRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UpdateFileSystemResponseUnmarshaller.Instance;

            return(InvokeAsync <UpdateFileSystemResponse>(request, options, cancellationToken));
        }
コード例 #4
0
        internal virtual UpdateFileSystemResponse UpdateFileSystem(UpdateFileSystemRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UpdateFileSystemRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UpdateFileSystemResponseUnmarshaller.Instance;

            return(Invoke <UpdateFileSystemResponse>(request, options));
        }
コード例 #5
0
        /// <summary>
        /// Updates the specified file system's information. You can use this operation to rename a file system.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <UpdateFileSystemResponse> UpdateFileSystem(UpdateFileSystemRequest request)
        {
            var uri = new Uri($"{GetEndPoint(FileStorageServices.FileSystems, this.Region)}");

            var headers = new HttpRequestHeaderParam()
            {
                IfMatch      = request.IfMatch,
                OpcRequestId = request.OpcRequestId
            };
            var webResponse = await this.RestClientAsync.Put(uri, request.UpdateFileSystemDetails, headers);

            using (var stream = webResponse.GetResponseStream())
                using (var reader = new StreamReader(stream))
                {
                    var response = reader.ReadToEnd();

                    return(new UpdateFileSystemResponse()
                    {
                        FileSystem = this.JsonSerializer.Deserialize <FileSystem>(response),
                        OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                        ETag = webResponse.Headers.Get("ETag")
                    });
                }
        }
コード例 #6
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            UpdateFileSystemRequest request;

            try
            {
                request = new UpdateFileSystemRequest
                {
                    FileSystemId            = FileSystemId,
                    UpdateFileSystemDetails = UpdateFileSystemDetails,
                    IfMatch      = IfMatch,
                    OpcRequestId = OpcRequestId
                };

                response = client.UpdateFileSystem(request).GetAwaiter().GetResult();
                WriteOutput(response, response.FileSystem);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }