Class: Azure::ApiManagement::Mgmt::V2016_10_10::ApiManagementClient

Inherits:
MsRestAzure::AzureServiceClient
  • Object
show all
Includes:
MsRestAzure, MsRestAzure::Serialization
Defined in:
lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb

Overview

A service client - single point of access to the REST API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials = nil, base_url = nil, options = nil) ⇒ ApiManagementClient

Creates initializes a new instance of the ApiManagementClient class.

Parameters:

  • credentials (MsRest::ServiceClientCredentials) (defaults to: nil)

    credentials to authorize HTTP requests made by the service client.

  • base_url (String) (defaults to: nil)

    the base URI of the service.

  • options (Array) (defaults to: nil)

    filters to be applied to the HTTP requests.



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 163

def initialize(credentials = nil, base_url = nil, options = nil)
  super(credentials, options)
  @base_url = base_url || 'https://management.azure.com'

  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
  @credentials = credentials

  @policy_snippets = PolicySnippets.new(self)
  @regions = Regions.new(self)
  @apis = Apis.new(self)
  @api_operations = ApiOperations.new(self)
  @api_operations_policy = ApiOperationsPolicy.new(self)
  @api_products = ApiProducts.new(self)
  @api_policy = ApiPolicy.new(self)
  @authorization_servers = AuthorizationServers.new(self)
  @backends = Backends.new(self)
  @certificates = Certificates.new(self)
  @api_management_operations = ApiManagementOperations.new(self)
  @api_management_services = ApiManagementServices.new(self)
  @groups = Groups.new(self)
  @group_users = GroupUsers.new(self)
  @identity_providers = IdentityProviders.new(self)
  @loggers = Loggers.new(self)
  @network_status = NetworkStatus.new(self)
  @open_id_connect_providers = OpenIdConnectProviders.new(self)
  @products = Products.new(self)
  @product_apis = ProductApis.new(self)
  @product_groups = ProductGroups.new(self)
  @product_subscriptions = ProductSubscriptions.new(self)
  @product_policy = ProductPolicy.new(self)
  @properties = Properties.new(self)
  @property = Property.new(self)
  @quota_by_counter_keys = QuotaByCounterKeys.new(self)
  @quota_by_period_keys = QuotaByPeriodKeys.new(self)
  @reports = Reports.new(self)
  @subscriptions = Subscriptions.new(self)
  @tenant_access = TenantAccess.new(self)
  @tenant_access_git = TenantAccessGit.new(self)
  @tenant_configuration = TenantConfiguration.new(self)
  @tenant_configuration_sync_state = TenantConfigurationSyncState.new(self)
  @tenant_policy = TenantPolicy.new(self)
  @users = Users.new(self)
  @user_groups = UserGroups.new(self)
  @user_subscriptions = UserSubscriptions.new(self)
  @user_identities = UserIdentities.new(self)
  @api_export = ApiExport.new(self)
  @api_version = '2016-10-10'
  @accept_language = 'en-US'
  @long_running_operation_retry_timeout = 30
  @generate_client_request_id = true
  add_telemetry
end

Instance Attribute Details

#accept_languageString

Returns The preferred language for the response.

Returns:

  • (String)

    The preferred language for the response.



29
30
31
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 29

def accept_language
  @accept_language
end

#api_exportApiExport (readonly)

Returns api_export.

Returns:



155
156
157
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 155

def api_export
  @api_export
end

#api_management_operationsApiManagementOperations (readonly)

Returns api_management_operations.

Returns:



71
72
73
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 71

def api_management_operations
  @api_management_operations
end

#api_management_servicesApiManagementServices (readonly)

Returns api_management_services.

Returns:



74
75
76
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 74

def api_management_services
  @api_management_services
end

#api_operationsApiOperations (readonly)

Returns api_operations.

Returns:



50
51
52
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 50

def api_operations
  @api_operations
end

#api_operations_policyApiOperationsPolicy (readonly)

Returns api_operations_policy.

Returns:



53
54
55
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 53

def api_operations_policy
  @api_operations_policy
end

#api_policyApiPolicy (readonly)

Returns api_policy.

Returns:



59
60
61
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 59

def api_policy
  @api_policy
end

#api_productsApiProducts (readonly)

Returns api_products.

Returns:



56
57
58
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 56

def api_products
  @api_products
end

#api_versionString (readonly)

Returns Version of the API to be used with the client request.

Returns:

  • (String)

    Version of the API to be used with the client request.



21
22
23
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 21

def api_version
  @api_version
end

#apisApis (readonly)

Returns apis.

Returns:



47
48
49
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 47

def apis
  @apis
end

#authorization_serversAuthorizationServers (readonly)

Returns authorization_servers.

Returns:



62
63
64
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 62

def authorization_servers
  @authorization_servers
end

#backendsBackends (readonly)

Returns backends.

Returns:



65
66
67
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 65

def backends
  @backends
end

#base_urlString

Returns the base URI of the service.

Returns:

  • (String)

    the base URI of the service.



15
16
17
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 15

def base_url
  @base_url
end

#certificatesCertificates (readonly)

Returns certificates.

Returns:



68
69
70
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 68

def certificates
  @certificates
end

#credentialsObject (readonly)

Returns Credentials needed for the client to connect to Azure.

Returns:

  • Credentials needed for the client to connect to Azure.



18
19
20
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 18

def credentials
  @credentials
end

#generate_client_request_idBoolean

generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.

Returns:

  • (Boolean)

    Whether a unique x-ms-client-request-id should be



38
39
40
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 38

def generate_client_request_id
  @generate_client_request_id
end

#group_usersGroupUsers (readonly)

Returns group_users.

Returns:



80
81
82
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 80

def group_users
  @group_users
end

#groupsGroups (readonly)

Returns groups.

Returns:



77
78
79
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 77

def groups
  @groups
end

#identity_providersIdentityProviders (readonly)

Returns identity_providers.

Returns:



83
84
85
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 83

def identity_providers
  @identity_providers
end

#loggersLoggers (readonly)

Returns loggers.

Returns:



86
87
88
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 86

def loggers
  @loggers
end

#long_running_operation_retry_timeoutInteger

Operations. Default value is 30.

Returns:

  • (Integer)

    The retry timeout in seconds for Long Running



33
34
35
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 33

def long_running_operation_retry_timeout
  @long_running_operation_retry_timeout
end

#network_statusNetworkStatus (readonly)

Returns network_status.

Returns:



89
90
91
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 89

def network_status
  @network_status
end

#open_id_connect_providersOpenIdConnectProviders (readonly)

Returns open_id_connect_providers.

Returns:



92
93
94
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 92

def open_id_connect_providers
  @open_id_connect_providers
end

#policy_snippetsPolicySnippets (readonly)

Returns policy_snippets.

Returns:



41
42
43
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 41

def policy_snippets
  @policy_snippets
end

#product_apisProductApis (readonly)

Returns product_apis.

Returns:



98
99
100
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 98

def product_apis
  @product_apis
end

#product_groupsProductGroups (readonly)

Returns product_groups.

Returns:



101
102
103
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 101

def product_groups
  @product_groups
end

#product_policyProductPolicy (readonly)

Returns product_policy.

Returns:



107
108
109
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 107

def product_policy
  @product_policy
end

#product_subscriptionsProductSubscriptions (readonly)

Returns product_subscriptions.

Returns:



104
105
106
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 104

def product_subscriptions
  @product_subscriptions
end

#productsProducts (readonly)

Returns products.

Returns:



95
96
97
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 95

def products
  @products
end

#propertiesProperties (readonly)

Returns properties.

Returns:



110
111
112
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 110

def properties
  @properties
end

#propertyProperty (readonly)

Returns property.

Returns:



113
114
115
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 113

def property
  @property
end

#quota_by_counter_keysQuotaByCounterKeys (readonly)

Returns quota_by_counter_keys.

Returns:



116
117
118
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 116

def quota_by_counter_keys
  @quota_by_counter_keys
end

#quota_by_period_keysQuotaByPeriodKeys (readonly)

Returns quota_by_period_keys.

Returns:



119
120
121
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 119

def quota_by_period_keys
  @quota_by_period_keys
end

#regionsRegions (readonly)

Returns regions.

Returns:



44
45
46
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 44

def regions
  @regions
end

#reportsReports (readonly)

Returns reports.

Returns:



122
123
124
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 122

def reports
  @reports
end

#subscription_idString

Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Returns:

  • (String)

    Subscription credentials which uniquely identify



26
27
28
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 26

def subscription_id
  @subscription_id
end

#subscriptionsSubscriptions (readonly)

Returns subscriptions.

Returns:



125
126
127
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 125

def subscriptions
  @subscriptions
end

#tenant_accessTenantAccess (readonly)

Returns tenant_access.

Returns:



128
129
130
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 128

def tenant_access
  @tenant_access
end

#tenant_access_gitTenantAccessGit (readonly)

Returns tenant_access_git.

Returns:



131
132
133
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 131

def tenant_access_git
  @tenant_access_git
end

#tenant_configurationTenantConfiguration (readonly)

Returns tenant_configuration.

Returns:



134
135
136
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 134

def tenant_configuration
  @tenant_configuration
end

#tenant_configuration_sync_stateTenantConfigurationSyncState (readonly)

Returns tenant_configuration_sync_state.

Returns:



137
138
139
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 137

def tenant_configuration_sync_state
  @tenant_configuration_sync_state
end

#tenant_policyTenantPolicy (readonly)

Returns tenant_policy.

Returns:



140
141
142
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 140

def tenant_policy
  @tenant_policy
end

#user_groupsUserGroups (readonly)

Returns user_groups.

Returns:



146
147
148
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 146

def user_groups
  @user_groups
end

#user_identitiesUserIdentities (readonly)

Returns user_identities.

Returns:



152
153
154
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 152

def user_identities
  @user_identities
end

#user_subscriptionsUserSubscriptions (readonly)

Returns user_subscriptions.

Returns:



149
150
151
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 149

def user_subscriptions
  @user_subscriptions
end

#usersUsers (readonly)

Returns users.

Returns:



143
144
145
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 143

def users
  @users
end

Instance Method Details

#make_request(method, path, options = {}) ⇒ Hash{String=>String}

Makes a request and returns the body of the response. Example:

request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
path = "/path"
options = {
  body: request_content,
  query_params: {'api-version' => '2016-02-01'}
}
result = @client.make_request(:put, path, options)

Parameters:

  • method (Symbol)

    with any of the following values :get, :put, :post, :patch, :delete.

  • path (String)

    the path, relative to #base_url.

  • options (Hash{String=>String}) (defaults to: {})

    specifying any request options like :body.

Returns:

  • (Hash{String=>String})

    containing the body of the response.



232
233
234
235
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 232

def make_request(method, path, options = {})
  result = make_request_with_http_info(method, path, options)
  result.body unless result.nil?
end

#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise

Makes a request asynchronously.

Parameters:

  • method (Symbol)

    with any of the following values :get, :put, :post, :patch, :delete.

  • path (String)

    the path, relative to #base_url.

  • options (Hash{String=>String}) (defaults to: {})

    specifying any request options like :body.

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 257

def make_request_async(method, path, options = {})
  fail ArgumentError, 'method is nil' if method.nil?
  fail ArgumentError, 'path is nil' if path.nil?

  request_url = options[:base_url] || @base_url
  if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
    @request_headers['Content-Type'] = options[:headers]['Content-Type']
  end

  request_headers = @request_headers
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
  options.merge!({headers: request_headers.merge(options[:headers] || {})})
  options.merge!({credentials: @credentials}) unless @credentials.nil?

  super(request_url, method, path, options)
end

#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse

Makes a request and returns the operation response.

Parameters:

  • method (Symbol)

    with any of the following values :get, :put, :post, :patch, :delete.

  • path (String)

    the path, relative to #base_url.

  • options (Hash{String=>String}) (defaults to: {})

    specifying any request options like :body.

Returns:

  • (MsRestAzure::AzureOperationResponse)

    Operation response containing the request, response and status.



244
245
246
247
248
# File 'lib/2016-10-10/generated/azure_mgmt_api_management/api_management_client.rb', line 244

def make_request_with_http_info(method, path, options = {})
  result = make_request_async(method, path, options).value!
  result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
  result
end