Class: Azure::ApiManagement::Mgmt::V2016_07_07::ApiManagementClient

Inherits:
MsRestAzure::AzureServiceClient
  • Object
show all
Includes:
MsRestAzure, MsRestAzure::Serialization
Defined in:
lib/2016-07-07/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.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb', line 139

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

  @apis = Apis.new(self)
  @api_operations = ApiOperations.new(self)
  @api_products = ApiProducts.new(self)
  @subscriptions = Subscriptions.new(self)
  @products = Products.new(self)
  @product_apis = ProductApis.new(self)
  @product_groups = ProductGroups.new(self)
  @groups = Groups.new(self)
  @group_users = GroupUsers.new(self)
  @certificates = Certificates.new(self)
  @policy_snippets = PolicySnippets.new(self)
  @product_subscriptions = ProductSubscriptions.new(self)
  @users = Users.new(self)
  @user_groups = UserGroups.new(self)
  @user_subscriptions = UserSubscriptions.new(self)
  @authorization_servers = AuthorizationServers.new(self)
  @regions = Regions.new(self)
  @user_identities = UserIdentities.new(self)
  @reports = Reports.new(self)
  @tenant_access = TenantAccess.new(self)
  @loggers = Loggers.new(self)
  @property = Property.new(self)
  @open_id_connect_providers = OpenIdConnectProviders.new(self)
  @tenant_access_git = TenantAccessGit.new(self)
  @tenant_configuration = TenantConfiguration.new(self)
  @tenant_configuration_sync_state = TenantConfigurationSyncState.new(self)
  @backends = Backends.new(self)
  @identity_providers = IdentityProviders.new(self)
  @quota_by_counter_keys = QuotaByCounterKeys.new(self)
  @quota_by_period_keys = QuotaByPeriodKeys.new(self)
  @api_management_services = ApiManagementServices.new(self)
  @api_version = '2016-07-07'
  @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-07-07/generated/azure_mgmt_api_management/api_management_client.rb', line 29

def accept_language
  @accept_language
end

#api_management_servicesApiManagementServices (readonly)

Returns api_management_services.

Returns:



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

def api_management_services
  @api_management_services
end

#api_operationsApiOperations (readonly)

Returns api_operations.

Returns:



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

def api_operations
  @api_operations
end

#api_productsApiProducts (readonly)

Returns api_products.

Returns:



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

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.



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

def api_version
  @api_version
end

#apisApis (readonly)

Returns apis.

Returns:



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

def apis
  @apis
end

#authorization_serversAuthorizationServers (readonly)

Returns authorization_servers.

Returns:



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

def authorization_servers
  @authorization_servers
end

#backendsBackends (readonly)

Returns backends.

Returns:



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

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-07-07/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-07-07/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-07-07/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-07-07/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:



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

def group_users
  @group_users
end

#groupsGroups (readonly)

Returns groups.

Returns:



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

def groups
  @groups
end

#identity_providersIdentityProviders (readonly)

Returns identity_providers.

Returns:



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

def identity_providers
  @identity_providers
end

#loggersLoggers (readonly)

Returns loggers.

Returns:



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

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-07-07/generated/azure_mgmt_api_management/api_management_client.rb', line 33

def long_running_operation_retry_timeout
  @long_running_operation_retry_timeout
end

#open_id_connect_providersOpenIdConnectProviders (readonly)

Returns open_id_connect_providers.

Returns:



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

def open_id_connect_providers
  @open_id_connect_providers
end

#policy_snippetsPolicySnippets (readonly)

Returns policy_snippets.

Returns:



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

def policy_snippets
  @policy_snippets
end

#product_apisProductApis (readonly)

Returns product_apis.

Returns:



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

def product_apis
  @product_apis
end

#product_groupsProductGroups (readonly)

Returns product_groups.

Returns:



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

def product_groups
  @product_groups
end

#product_subscriptionsProductSubscriptions (readonly)

Returns product_subscriptions.

Returns:



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

def product_subscriptions
  @product_subscriptions
end

#productsProducts (readonly)

Returns products.

Returns:



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

def products
  @products
end

#propertyProperty (readonly)

Returns property.

Returns:



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

def property
  @property
end

#quota_by_counter_keysQuotaByCounterKeys (readonly)

Returns quota_by_counter_keys.

Returns:



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

def quota_by_counter_keys
  @quota_by_counter_keys
end

#quota_by_period_keysQuotaByPeriodKeys (readonly)

Returns quota_by_period_keys.

Returns:



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

def quota_by_period_keys
  @quota_by_period_keys
end

#regionsRegions (readonly)

Returns regions.

Returns:



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

def regions
  @regions
end

#reportsReports (readonly)

Returns reports.

Returns:



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

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



23
24
25
# File 'lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb', line 23

def subscription_id
  @subscription_id
end

#subscriptionsSubscriptions (readonly)

Returns subscriptions.

Returns:



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

def subscriptions
  @subscriptions
end

#tenant_accessTenantAccess (readonly)

Returns tenant_access.

Returns:



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

def tenant_access
  @tenant_access
end

#tenant_access_gitTenantAccessGit (readonly)

Returns tenant_access_git.

Returns:



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

def tenant_access_git
  @tenant_access_git
end

#tenant_configurationTenantConfiguration (readonly)

Returns tenant_configuration.

Returns:



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

def tenant_configuration
  @tenant_configuration
end

#tenant_configuration_sync_stateTenantConfigurationSyncState (readonly)

Returns tenant_configuration_sync_state.

Returns:



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

def tenant_configuration_sync_state
  @tenant_configuration_sync_state
end

#user_groupsUserGroups (readonly)

Returns user_groups.

Returns:



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

def user_groups
  @user_groups
end

#user_identitiesUserIdentities (readonly)

Returns user_identities.

Returns:



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

def user_identities
  @user_identities
end

#user_subscriptionsUserSubscriptions (readonly)

Returns user_subscriptions.

Returns:



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

def user_subscriptions
  @user_subscriptions
end

#usersUsers (readonly)

Returns users.

Returns:



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

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.



200
201
202
203
# File 'lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb', line 200

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.



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb', line 225

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.



212
213
214
215
216
# File 'lib/2016-07-07/generated/azure_mgmt_api_management/api_management_client.rb', line 212

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