private static void KeystoneShowPermission(IamClient iamClient) { var keystoneShowPermissionRequest = new KeystoneShowPermissionRequest() { RoleId = "" }; try { var keystoneShowPermissionResponse = iamClient.KeystoneShowPermission(keystoneShowPermissionRequest); Console.WriteLine(JsonConvert.SerializeObject(keystoneShowPermissionResponse.Role)); } 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); } }
/// <summary> /// 查询权限详情 /// </summary> public KeystoneShowPermissionResponse KeystoneShowPermission(KeystoneShowPermissionRequest keystoneShowPermissionRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); urlParam.Add("role_id", keystoneShowPermissionRequest.RoleId.ToString()); string urlPath = HttpUtils.AddUrlPath("/v3/roles/{role_id}", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, keystoneShowPermissionRequest); SdkResponse response = DoHttpRequest("GET", request); return(JsonUtils.DeSerialize <KeystoneShowPermissionResponse>(response)); }