Class: IbmCloudIam::AccountLimitsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ibm_cloud_iam/api/account_limits_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountLimitsApi

Returns a new instance of AccountLimitsApi.



19
20
21
# File 'lib/ibm_cloud_iam/api/account_limits_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/ibm_cloud_iam/api/account_limits_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#bulk_list_account_entity_consumption(account_id, authorization, opts = {}) ⇒ IdentityLimitsUsageResponse

Get account entity limits via POST request Returns the details of an account's entity limits using a body for larger list of parameters for consumption details.

Parameters:

  • account_id (String)

    Unique ID of the account.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Please make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



29
30
31
32
# File 'lib/ibm_cloud_iam/api/account_limits_api.rb', line 29

def (, authorization, opts = {})
  data, _status_code, _headers = (, authorization, opts)
  data
end

#bulk_list_account_entity_consumption_with_http_info(account_id, authorization, opts = {}) ⇒ Array<(IdentityLimitsUsageResponse, Integer, Hash)>

Get account entity limits via POST request Returns the details of an account's entity limits using a body for larger list of parameters for consumption details.

Parameters:

  • account_id (String)

    Unique ID of the account.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Please make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(IdentityLimitsUsageResponse, Integer, Hash)>)

    IdentityLimitsUsageResponse data, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/ibm_cloud_iam/api/account_limits_api.rb', line 41

def (, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountLimitsApi.bulk_list_account_entity_consumption ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountLimitsApi.bulk_list_account_entity_consumption"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling AccountLimitsApi.bulk_list_account_entity_consumption"
  end
  # resource path
  local_var_path = '/v1/accounts/{account_id}/limits/identity'.sub('{account_id}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'identity_limits_usage_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'IdentityLimitsUsageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountLimitsApi.bulk_list_account_entity_consumption",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountLimitsApi#bulk_list_account_entity_consumption\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_limits(account_id, authorization, opts = {}) ⇒ IdentityLimitsUsageResponse

Get account entity limits Returns the details of an account's entity limits with query parameters for consumption details.

Parameters:

  • account_id (String)

    Unique ID of the account.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Please make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :serviceid_groups (Boolean)

    Boolean to include serviceid group consumption.

  • :serviceids_per_group (String)

    Comma seperated list of ServiceID groups to include for consumption.

  • :profiles (String)

    Boolean to include trusted profiles consumption.

  • :apikeys_per_identity (String)

    Comma seperated list of IAM IDs to include for API key consumption.

  • :templates (String)

    Boolean to include template consumption.

  • :template_versions_per_template (String)

    Comma seperated list of template IDs to include for template version consumption.

  • :idps (String)

    Boolean to include identity provider consumption.

  • :claim_rules_per_group (String)

    Comma seperated list of access groups to include for claim rules consumption.

  • :claim_rules_per_profile (String)

    Comma seperated list of profiles to include for claim rules consumption.

  • :cr_links (String)

    Boolean to include compute resource links consumption.

  • :cr_links_per_profile (String)

    Comma seperated list of profile IDs to include for cr links consumption.

  • :cr_rules (String)

    Boolean to include compute resource rules consumption.

  • :cr_rules_per_profile (String)

    Comma seperated list of profile IDs to include for cr rules consumption.

Returns:



118
119
120
121
# File 'lib/ibm_cloud_iam/api/account_limits_api.rb', line 118

def (, authorization, opts = {})
  data, _status_code, _headers = (, authorization, opts)
  data
end

#get_account_limits_with_http_info(account_id, authorization, opts = {}) ⇒ Array<(IdentityLimitsUsageResponse, Integer, Hash)>

Get account entity limits Returns the details of an account's entity limits with query parameters for consumption details.

Parameters:

  • account_id (String)

    Unique ID of the account.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Please make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :serviceid_groups (Boolean)

    Boolean to include serviceid group consumption.

  • :serviceids_per_group (String)

    Comma seperated list of ServiceID groups to include for consumption.

  • :profiles (String)

    Boolean to include trusted profiles consumption.

  • :apikeys_per_identity (String)

    Comma seperated list of IAM IDs to include for API key consumption.

  • :templates (String)

    Boolean to include template consumption.

  • :template_versions_per_template (String)

    Comma seperated list of template IDs to include for template version consumption.

  • :idps (String)

    Boolean to include identity provider consumption.

  • :claim_rules_per_group (String)

    Comma seperated list of access groups to include for claim rules consumption.

  • :claim_rules_per_profile (String)

    Comma seperated list of profiles to include for claim rules consumption.

  • :cr_links (String)

    Boolean to include compute resource links consumption.

  • :cr_links_per_profile (String)

    Comma seperated list of profile IDs to include for cr links consumption.

  • :cr_rules (String)

    Boolean to include compute resource rules consumption.

  • :cr_rules_per_profile (String)

    Comma seperated list of profile IDs to include for cr rules consumption.

Returns:

  • (Array<(IdentityLimitsUsageResponse, Integer, Hash)>)

    IdentityLimitsUsageResponse data, response status code and response headers



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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/ibm_cloud_iam/api/account_limits_api.rb', line 142

def (, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountLimitsApi.get_account_limits ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountLimitsApi.get_account_limits"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling AccountLimitsApi.get_account_limits"
  end
  # resource path
  local_var_path = '/v1/accounts/{account_id}/limits/identity'.sub('{account_id}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'serviceid_groups'] = opts[:'serviceid_groups'] if !opts[:'serviceid_groups'].nil?
  query_params[:'serviceids_per_group'] = opts[:'serviceids_per_group'] if !opts[:'serviceids_per_group'].nil?
  query_params[:'profiles'] = opts[:'profiles'] if !opts[:'profiles'].nil?
  query_params[:'apikeys_per_identity'] = opts[:'apikeys_per_identity'] if !opts[:'apikeys_per_identity'].nil?
  query_params[:'templates'] = opts[:'templates'] if !opts[:'templates'].nil?
  query_params[:'template_versions_per_template'] = opts[:'template_versions_per_template'] if !opts[:'template_versions_per_template'].nil?
  query_params[:'idps'] = opts[:'idps'] if !opts[:'idps'].nil?
  query_params[:'claim_rules_per_group'] = opts[:'claim_rules_per_group'] if !opts[:'claim_rules_per_group'].nil?
  query_params[:'claim_rules_per_profile'] = opts[:'claim_rules_per_profile'] if !opts[:'claim_rules_per_profile'].nil?
  query_params[:'cr_links'] = opts[:'cr_links'] if !opts[:'cr_links'].nil?
  query_params[:'cr_links_per_profile'] = opts[:'cr_links_per_profile'] if !opts[:'cr_links_per_profile'].nil?
  query_params[:'cr_rules'] = opts[:'cr_rules'] if !opts[:'cr_rules'].nil?
  query_params[:'cr_rules_per_profile'] = opts[:'cr_rules_per_profile'] if !opts[:'cr_rules_per_profile'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'IdentityLimitsUsageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountLimitsApi.get_account_limits",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountLimitsApi#get_account_limits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end