コード例 #1
0
        public Container.Container GetContainer(CancellationToken context, ContainerID cid, CallOptions options = null)
        {
            var container_client = new ContainerService.ContainerServiceClient(channel);
            var opts             = DefaultCallOptions.ApplyCustomOptions(options);
            var req = new GetRequest
            {
                Body = new GetRequest.Types.Body
                {
                    ContainerId = cid
                }
            };

            req.MetaHeader = opts.GetRequestMetaHeader();
            req.SignRequest(key);

            var resp = container_client.Get(req, cancellationToken: context);

            if (!resp.VerifyResponse())
            {
                throw new InvalidOperationException("invalid container get response");
            }
            return(resp.Body.Container);
        }
コード例 #2
0
 public void TestInvalidRequest()
 {
     var channel         = GrpcChannel.ForAddress(host, new() { Credentials = SslCredentials.Insecure });
     var containerClient = new ContainerService.ContainerServiceClient(channel);
     var container       = containerClient.Get(new GetRequest());
 }