Beispiel #1
0
        public async Task <HandlerResult> OnDeleted(string id, string entityJosn, Dictionary <string, string> switches)
        {
            try
            {
                var state    = JsonConvert.DeserializeObject <BindingwithResult>(entityJosn);
                var response = await OSBClient.UnbindAsync(switches["OSBEndpoint"], switches["OSBUser"], switches["OSBPassword"], state.Binding.InstanceId, state.Binding.ServiceId, state.Binding.PlanId, state.Binding.BindingId);

                return(new HandlerResult
                {
                    Succeeded = response.IsSuccessStatusCode,
                    ErrorMessage = response.ReasonPhrase,
                    HTTPStatus = response.StatusCode,
                    UpdatedEntity = null
                });
            }
            catch (Exception exp)
            {
                return(new HandlerResult
                {
                    Succeeded = false,
                    ErrorMessage = exp.Message,
                    HTTPStatus = System.Net.HttpStatusCode.InternalServerError,
                    UpdatedEntity = null
                });
            }
        }
Beispiel #2
0
        public async Task OSBUnbindAsync(CancellationToken cancellationToken)
        {
            var state = await this.StateManager.GetStateAsync <BindingwithResult>("bindingResult", cancellationToken);

            await OSBClient.UnbindAsync("http://104.45.224.242", "haishi", "P$ssword!", state.Binding.InstanceId, state.Binding.ServiceId, state.Binding.PlanId, state.Binding.BindingId);
        }