Exemplo n.º 1
0
        /// <summary>
        /// Gets the status of the service.
        /// </summary>
        /// <param name="request">The request object containing the details to send. Required.</param>
        /// <param name="retryConfiguration">The retry configuration that will be used by to send this request. Optional.</param>
        /// <param name="cancellationToken">The cancellation token to cancel this operation. Optional.</param>
        /// <returns>A response object containing details about the completed operation</returns>
        /// <example>Click <a href="https://docs.cloud.oracle.com/en-us/iaas/tools/dot-net-examples/latest/cims/GetStatus.cs.html">here</a> to see an example of how to use GetStatus API.</example>
        public async Task <GetStatusResponse> GetStatus(GetStatusRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default)
        {
            logger.Trace("Called getStatus");
            Uri                uri            = new Uri(this.restClient.GetEndpoint(), System.IO.Path.Combine(basePathWithoutHost, "/v2/incidents/status/{source}".Trim('/')));
            HttpMethod         method         = new HttpMethod("GET");
            HttpRequestMessage requestMessage = Converter.ToHttpRequestMessage(uri, method, request);

            requestMessage.Headers.Add("Accept", "application/json");
            GenericRetrier      retryingClient = Retrier.GetPreferredRetrier(retryConfiguration, this.retryConfiguration);
            HttpResponseMessage responseMessage;

            try
            {
                if (retryingClient != null)
                {
                    responseMessage = await retryingClient.MakeRetryingCall(this.restClient.HttpSend, requestMessage, cancellationToken).ConfigureAwait(false);
                }
                else
                {
                    responseMessage = await this.restClient.HttpSend(requestMessage).ConfigureAwait(false);
                }
                this.restClient.CheckHttpResponseMessage(requestMessage, responseMessage);

                return(Converter.FromHttpResponseMessage <GetStatusResponse>(responseMessage));
            }
            catch (Exception e)
            {
                logger.Error($"GetStatus failed with error: {e.Message}");
                throw;
            }
        }
        public void StatusRequest_To_CreatesCorrectUriParameters()
        {
            var request = new GetStatusRequest()
            {
                To = new DateTime(2018, 6, 12, 11, 45, 0)
            };
            var parameters = request.GetUriPathParameters();

            Assert.That(parameters["to"], Is.EqualTo("11:45"));
        }
        public void StatusRequest_From_CreatesCorrectUriParameters()
        {
            var request = new GetStatusRequest()
            {
                From = new DateTime(2018, 6, 12, 10, 12, 0)
            };
            var parameters = request.GetUriPathParameters();

            Assert.That(parameters["from"], Is.EqualTo("10:12"));
        }
        public Task <HttpResponseMessage> Get(int id)
        {
            var request = new GetStatusRequest {
                StatusId = id
            };

            return(_StatusService.GetStatusAsync(request).ContinueWith(resp =>
            {
                var message = resp.Result;
                var viewModel = _Mapper.Map <StatusViewModel>(message.Status);
                return _ResponseMapper.ForGet(Request, viewModel, message.Result);
            }));
        }
Exemplo n.º 5
0
        public string GetStatus()
        {
            var request = new GetStatusRequest()
            {
                Thread = grpcSbThread
            };
            GetStatusResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetStatus(request);
            }))
            {
                return(response.Status);
            }
            return("");
        }
Exemplo n.º 6
0
		public GetStatusResponse GetStatus(GetStatusRequest request)
		{
			Platform.Log(LogLevel.Debug, "Received manifest status query.");
			return new GetStatusResponse {IsValid = ManifestVerification.Valid};
		}
Exemplo n.º 7
0
 public GetStatusResponse GetStatus(GetStatusRequest request)
 {
     log.InfoFormat("GetStatus:\n  VM: {0}", request.Vm);
     
     Status status = GetVmStatus(request.Vm, true);
     
     return new GetStatusResponse()
     {
         Status = status
     };
 }
Exemplo n.º 8
0
        public Status GetStatus()
        {
            CheckProfileHasMaster();
            CheckProfileHasVM();

            Log(string.Format("Getting status of VM '{0}'.", profile.VM));

            GetStatusRequest request = new GetStatusRequest() { Vm = profile.VM };
            GetStatusResponse response = GetMasterClient().GetStatus(request);
            return response.Status;
        }
 /// <summary>
 /// Get the status of your service
 /// </summary>
 /// <returns> GetStatusResponse object</returns>
 /// <param name="request"> GetStatusRequest object</param>
 /// <param name='jsonRpcCallId'>
 /// The json rpc call identifier. This is a string generated by the client, which can be used to correlate the response to the request. Max length is 256 characters. A JSON-RPC id must be generated on a per call invocation basis. The Rogerthat platform uses the id of the call to store the call result for a certain amount of time so that if something fails during the communication, the same call (having the same JSON-RPC id) can be resent to the Rogerthat service, allowing to fetch the result, without actually executing the call again. This avoids annoying problems such as duplicate delivery of messages.
 /// 
 /// You should use a different JSON-RPC id for every call you make.
 /// 
 /// In case of an intermittent failure such as a network connectivity problem, you can retry the same call using the same JSON-RPC id, without running the risk of duplicate execution of your call (e.g. duplicate message delivery).
 /// </param>
 public GetStatusResponse GetStatus(GetStatusRequest request, string jsonRpcCallId)
 {
     GetStatusResponse result = new GetStatusResponse();
     WireRequest(0, jsonRpcCallId, "system.get_status", (writer) =>
         {
             request.Write(writer, false);
         }, (reader) =>
         {
             result.Read(reader);
         }
     );
     return result;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Get the status of your service
 /// </summary>
 /// <returns> GetStatusResponse object</returns>
 /// <param name="request"> GetStatusRequest object</param>
 public GetStatusResponse GetStatus(GetStatusRequest request)
 {
     return GetStatus(request, Guid.NewGuid().ToString());
 }