コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="request">
 /// The request object containing all of the parameters for the API call.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// A pageable sequence of <see cref="Snapshot"/> resources.
 /// </returns>
 public override gax::PagedEnumerable <ListSnapshotsResponse, Snapshot> ListSnapshots(
     ListSnapshotsRequest request,
     gaxgrpc::CallSettings callSettings = null)
 {
     Modify_ListSnapshotsRequest(ref request, ref callSettings);
     return(new gaxgrpc::GrpcPagedEnumerable <ListSnapshotsRequest, ListSnapshotsResponse, Snapshot>(_callListSnapshots, request, callSettings));
 }
コード例 #2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListSnapshotsRequest request;

            try
            {
                request = new ListSnapshotsRequest
                {
                    FileSystemId   = FileSystemId,
                    Limit          = Limit,
                    Page           = Page,
                    LifecycleState = LifecycleState,
                    Id             = Id,
                    SortOrder      = SortOrder,
                    OpcRequestId   = OpcRequestId
                };
                IEnumerable <ListSnapshotsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.Items, true);
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
コード例 #3
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListSnapshotsRequest request;

            try
            {
                request = new ListSnapshotsRequest
                {
                    FileSystemId   = FileSystemId,
                    Limit          = Limit,
                    Page           = Page,
                    LifecycleState = LifecycleState,
                    Id             = Id,
                    SortOrder      = SortOrder,
                    OpcRequestId   = OpcRequestId
                };
                IEnumerable <ListSnapshotsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.Items, true);
                }
                if (!ParameterSetName.Equals(AllPageSet) && !ParameterSetName.Equals(LimitSet) && response.OpcNextPage != null)
                {
                    WriteWarning("This operation supports pagination and not all resources were returned. Re-run using the -All option to auto paginate and list all resources.");
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
コード例 #4
0
        private static void ListSnapshots(EvsClient client)
        {
            ListSnapshotsRequest req = new ListSnapshotsRequest()
            {
                ServiceType = "EVS",
                Limit       = 2,
                Offset      = 0,
                Name        = "test"
            };

            try
            {
                ListSnapshotsResponse resp = client.ListSnapshots(req);
                Console.WriteLine(resp.Count);
                Console.WriteLine(resp.HttpStatusCode);
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }
コード例 #5
0
        public ListSnapshotsResponse ListSnapshots(ListSnapshotsRequest request)
        {
            var command = new ListSnapshots(_apiKey, _secret, _baseUri, _authenticator, _builder)
            {
                Parameters = request
            };

            return((ListSnapshotsResponse)((ICommandExecutor)this).Execute(command));
        }
コード例 #6
0
        /// <summary>
        /// 查询云硬盘快照详细列表信息
        /// </summary>
        public ListSnapshotsResponse ListSnapshots(ListSnapshotsRequest listSnapshotsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();
            string              urlPath          = HttpUtils.AddUrlPath("/v2/{project_id}/cloudsnapshots/detail", urlParam);
            SdkRequest          request          = HttpUtils.InitSdkRequest(urlPath, "application/json", listSnapshotsRequest);
            HttpResponseMessage response         = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ListSnapshotsResponse>(response));
        }
コード例 #7
0
        /// <summary>
        /// 构建查询截图作业参数 【私有方法】
        /// </summary>
        /// <param name="client"></param>
        /// <returns>ListSnapshotsResponse</returns>
        private static ListSnapshotsResponse ListSnapshots(DefaultAcsClient client)
        {
            // 构造请求
            ListSnapshotsRequest request = new ListSnapshotsRequest();

            // 视频ID
            request.VideoId = videoId;
            // 截图类型
            request.SnapshotType = "CoverSnapshot";
            request.PageNo       = "1";
            request.PageSize     = "20";
            return(client.GetAcsResponse(request));
        }
コード例 #8
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListSnapshotsRequest, CallSettings)
            // Create client
            SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();

            // Initialize request argument(s)
            ListSnapshotsRequest request = new ListSnapshotsRequest
            {
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <SnapshotList, Snapshot> response = snapshotsClient.ListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Snapshot item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((SnapshotList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Snapshot item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int             pageSize   = 10;
            Page <Snapshot> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Snapshot item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
コード例 #9
0
 /// <summary>
 /// Creates a new enumerable which will iterate over the responses received from the ListSnapshots operation. This enumerable
 /// will fetch more data from the server as needed.
 /// </summary>
 /// <param name="request">The request object containing the details to send</param>
 /// <param name="retryConfiguration">The configuration for retrying, may be null</param>
 /// <param name="cancellationToken">The cancellation token object</param>
 /// <returns>The enumerator, which supports a simple iteration over a collection of a specified type</returns>
 public IEnumerable <ListSnapshotsResponse> ListSnapshotsResponseEnumerator(ListSnapshotsRequest request, Common.Retry.RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default)
 {
     return(new Common.Utils.ResponseEnumerable <ListSnapshotsRequest, ListSnapshotsResponse>(
                response => response.OpcNextPage,
                input =>
     {
         if (!string.IsNullOrEmpty(input))
         {
             request.Page = input;
         }
         return request;
     },
                request => client.ListSnapshots(request, retryConfiguration, cancellationToken)
                ));
 }
コード例 #10
0
 /// <summary>Snippet for ListSnapshots</summary>
 public void ListSnapshotsRequestObject()
 {
     // Snippet: ListSnapshots(ListSnapshotsRequest, CallSettings)
     // Create client
     SnapshotsV1Beta3Client snapshotsV1Beta3Client = SnapshotsV1Beta3Client.Create();
     // Initialize request argument(s)
     ListSnapshotsRequest request = new ListSnapshotsRequest
     {
         ProjectId = "",
         Location  = "",
         JobId     = "",
     };
     // Make the request
     ListSnapshotsResponse response = snapshotsV1Beta3Client.ListSnapshots(request);
     // End snippet
 }
コード例 #11
0
        /// <summary>Snippet for ListSnapshotsAsync</summary>
        public async Task ListSnapshotsAsync_RequestObject()
        {
            // Snippet: ListSnapshotsAsync(ListSnapshotsRequest,CallSettings)
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync();

            // Initialize request argument(s)
            ListSnapshotsRequest request = new ListSnapshotsRequest
            {
                ParentAsClusterName = new ClusterName("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
            };
            // Make the request
            PagedAsyncEnumerable <ListSnapshotsResponse, Snapshot> response =
                bigtableTableAdminClient.ListSnapshotsAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Snapshot item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListSnapshotsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Snapshot item in page)
                {
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int             pageSize   = 10;
            Page <Snapshot> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Snapshot item in singlePage)
            {
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
        /// <summary>Snippet for ListSnapshots</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ListSnapshotsRequestObject()
        {
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create();
            // Initialize request argument(s)
            ListSnapshotsRequest request = new ListSnapshotsRequest
            {
                ParentAsClusterName = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
            };
            // Make the request
            PagedEnumerable <ListSnapshotsResponse, Snapshot> response = bigtableTableAdminClient.ListSnapshots(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Snapshot item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListSnapshotsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Snapshot item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int             pageSize   = 10;
            Page <Snapshot> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Snapshot item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }
コード例 #13
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListSnapshotsRequest, CallSettings)
     // Create client
     SnapshotsClient snapshotsClient = SnapshotsClient.Create();
     // Initialize request argument(s)
     ListSnapshotsRequest request = new ListSnapshotsRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Filter               = "",
         OrderBy              = "",
         Project              = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     SnapshotList response = snapshotsClient.List(request);
     // End snippet
 }
コード例 #14
0
        /// <summary>Snippet for ListSnapshotsAsync</summary>
        public async Task ListSnapshotsRequestObjectAsync()
        {
            // Snippet: ListSnapshotsAsync(ListSnapshotsRequest, CallSettings)
            // Additional: ListSnapshotsAsync(ListSnapshotsRequest, CancellationToken)
            // Create client
            SnapshotsV1Beta3Client snapshotsV1Beta3Client = await SnapshotsV1Beta3Client.CreateAsync();

            // Initialize request argument(s)
            ListSnapshotsRequest request = new ListSnapshotsRequest
            {
                ProjectId = "",
                Location  = "",
                JobId     = "",
            };
            // Make the request
            ListSnapshotsResponse response = await snapshotsV1Beta3Client.ListSnapshotsAsync(request);

            // End snippet
        }
コード例 #15
0
        public void ListSnapshotsRequestObject()
        {
            moq::Mock <SnapshotsV1Beta3.SnapshotsV1Beta3Client> mockGrpcClient = new moq::Mock <SnapshotsV1Beta3.SnapshotsV1Beta3Client>(moq::MockBehavior.Strict);
            ListSnapshotsRequest request = new ListSnapshotsRequest
            {
                ProjectId = "project_id43ad98b0",
                Location  = "locatione09d18d5",
                JobId     = "job_id38ea97d6",
            };
            ListSnapshotsResponse expectedResponse = new ListSnapshotsResponse
            {
                Snapshots = { new Snapshot(), },
            };

            mockGrpcClient.Setup(x => x.ListSnapshots(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            SnapshotsV1Beta3Client client   = new SnapshotsV1Beta3ClientImpl(mockGrpcClient.Object, null);
            ListSnapshotsResponse  response = client.ListSnapshots(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #16
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListSnapshotsRequest, CallSettings)
            // Additional: ListAsync(ListSnapshotsRequest, CancellationToken)
            // Create client
            SnapshotsClient snapshotsClient = await SnapshotsClient.CreateAsync();

            // Initialize request argument(s)
            ListSnapshotsRequest request = new ListSnapshotsRequest
            {
                PageToken            = "",
                MaxResults           = 0U,
                Filter               = "",
                OrderBy              = "",
                Project              = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            SnapshotList response = await snapshotsClient.ListAsync(request);

            // End snippet
        }
コード例 #17
0
        public async stt::Task ListSnapshotsRequestObjectAsync()
        {
            moq::Mock <SnapshotsV1Beta3.SnapshotsV1Beta3Client> mockGrpcClient = new moq::Mock <SnapshotsV1Beta3.SnapshotsV1Beta3Client>(moq::MockBehavior.Strict);
            ListSnapshotsRequest request = new ListSnapshotsRequest
            {
                ProjectId = "project_id43ad98b0",
                Location  = "locatione09d18d5",
                JobId     = "job_id38ea97d6",
            };
            ListSnapshotsResponse expectedResponse = new ListSnapshotsResponse
            {
                Snapshots = { new Snapshot(), },
            };

            mockGrpcClient.Setup(x => x.ListSnapshotsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ListSnapshotsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            SnapshotsV1Beta3Client client = new SnapshotsV1Beta3ClientImpl(mockGrpcClient.Object, null);
            ListSnapshotsResponse  responseCallSettings = await client.ListSnapshotsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            ListSnapshotsResponse responseCancellationToken = await client.ListSnapshotsAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
コード例 #18
0
 partial void Modify_ListSnapshotsRequest(ref ListSnapshotsRequest request, ref gaxgrpc::CallSettings settings);
コード例 #19
0
 /// <summary>
 /// Lists snapshots.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <ListSnapshotsResponse> ListSnapshotsAsync(ListSnapshotsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
コード例 #20
0
 /// <summary>
 /// Lists snapshots.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public virtual ListSnapshotsResponse ListSnapshots(ListSnapshotsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
コード例 #21
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="request">
 /// The request object containing all of the parameters for the API call.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// A pageable sequence of <see cref="Snapshot"/> resources.
 /// </returns>
 public virtual gax::PagedEnumerable <ListSnapshotsResponse, Snapshot> ListSnapshots(
     ListSnapshotsRequest request,
     gaxgrpc::CallSettings callSettings = null)
 {
     throw new sys::NotImplementedException();
 }
コード例 #22
0
 /// <summary>
 /// Lists snapshots.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public override ListSnapshotsResponse ListSnapshots(ListSnapshotsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_ListSnapshotsRequest(ref request, ref callSettings);
     return(_callListSnapshots.Sync(request, callSettings));
 }
コード例 #23
0
 /// <summary>
 /// Lists snapshots.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override stt::Task <ListSnapshotsResponse> ListSnapshotsAsync(ListSnapshotsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_ListSnapshotsRequest(ref request, ref callSettings);
     return(_callListSnapshots.Async(request, callSettings));
 }
コード例 #24
0
 /// <summary>
 /// Lists snapshots.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <ListSnapshotsResponse> ListSnapshotsAsync(ListSnapshotsRequest request, st::CancellationToken cancellationToken) =>
 ListSnapshotsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
コード例 #25
0
 public override Task <ListSnapshotsResponse> ListSnapshots(ListSnapshotsRequest request, ServerCallContext context)
 {
     return(base.ListSnapshots(request, context));
 }