Class: Azure::ApiManagement::Mgmt::V2019_01_01::Reports

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb

Overview

ApiManagement Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Reports

Creates and initializes a new instance of the Reports class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientApiManagementClient (readonly)

Returns reference to the ApiManagementClient.

Returns:



22
23
24
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 22

def client
  @client
end

Instance Method Details

#list_by_api(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Array<ReportRecordContract>

Lists report records by API.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    The filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (Array<ReportRecordContract>)

    operation results.



38
39
40
41
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 38

def list_by_api(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  first_page = list_by_api_as_lazy(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_api_as_lazy(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ ReportCollection

Lists report records by API.

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    The filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    which provide lazy access to pages of the



1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1866

def list_by_api_as_lazy(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  response = list_by_api_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_api_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_api_async(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by API.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    The filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 75

def list_by_api_async(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'filter is nil' if filter.nil?
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'$orderby' => orderby,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_api_next(next_page_link, custom_headers: nil) ⇒ ReportCollection

Lists report records by API.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    operation results.



1231
1232
1233
1234
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1231

def list_by_api_next(next_page_link, custom_headers:nil)
  response = list_by_api_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_api_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by API.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1260

def list_by_api_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_api_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by API.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1246
1247
1248
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1246

def list_by_api_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_api_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_api_with_http_info(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by API.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    The filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



57
58
59
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 57

def list_by_api_with_http_info(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  list_by_api_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
end

#list_by_geo(resource_group_name, service_name, filter, top: nil, skip: nil, custom_headers: nil) ⇒ Array<ReportRecordContract>

Lists report records by geography.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

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

    A hash of custom headers that

Returns:

  • (Array<ReportRecordContract>)

    operation results.



641
642
643
644
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 641

def list_by_geo(resource_group_name, service_name, filter, top:nil, skip:nil, custom_headers:nil)
  first_page = list_by_geo_as_lazy(resource_group_name, service_name, filter, top:top, skip:skip, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_geo_as_lazy(resource_group_name, service_name, filter, top: nil, skip: nil, custom_headers: nil) ⇒ ReportCollection

Lists report records by geography.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    which provide lazy access to pages of the



2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 2031

def list_by_geo_as_lazy(resource_group_name, service_name, filter, top:nil, skip:nil, custom_headers:nil)
  response = list_by_geo_async(resource_group_name, service_name, filter, top:top, skip:skip, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_geo_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_geo_async(resource_group_name, service_name, filter, top: nil, skip: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by geography.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 706

def list_by_geo_async(resource_group_name, service_name, filter, top:nil, skip:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'filter is nil' if filter.nil?
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_geo_next(next_page_link, custom_headers: nil) ⇒ ReportCollection

Lists report records by geography.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    operation results.



1591
1592
1593
1594
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1591

def list_by_geo_next(next_page_link, custom_headers:nil)
  response = list_by_geo_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_geo_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by geography.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1620

def list_by_geo_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_geo_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by geography.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1606
1607
1608
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1606

def list_by_geo_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_geo_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_geo_with_http_info(resource_group_name, service_name, filter, top: nil, skip: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by geography.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



674
675
676
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 674

def list_by_geo_with_http_info(resource_group_name, service_name, filter, top:nil, skip:nil, custom_headers:nil)
  list_by_geo_async(resource_group_name, service_name, filter, top:top, skip:skip, custom_headers:custom_headers).value!
end

#list_by_operation(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Array<ReportRecordContract>

Lists report records by API Operations.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (Array<ReportRecordContract>)

    operation results.



326
327
328
329
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 326

def list_by_operation(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  first_page = list_by_operation_as_lazy(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_operation_as_lazy(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ ReportCollection

Lists report records by API Operations.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    which provide lazy access to pages of the



1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1950

def list_by_operation_as_lazy(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  response = list_by_operation_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_operation_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_operation_async(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by API Operations.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 395

def list_by_operation_async(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'filter is nil' if filter.nil?
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'$orderby' => orderby,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_operation_next(next_page_link, custom_headers: nil) ⇒ ReportCollection

Lists report records by API Operations.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    operation results.



1411
1412
1413
1414
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1411

def list_by_operation_next(next_page_link, custom_headers:nil)
  response = list_by_operation_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_operation_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by API Operations.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1440

def list_by_operation_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_operation_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by API Operations.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1426
1427
1428
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1426

def list_by_operation_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_operation_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_operation_with_http_info(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by API Operations.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



361
362
363
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 361

def list_by_operation_with_http_info(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  list_by_operation_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
end

#list_by_product(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Array<ReportRecordContract>

Lists report records by Product.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (Array<ReportRecordContract>)

    operation results.



485
486
487
488
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 485

def list_by_product(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  first_page = list_by_product_as_lazy(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_product_as_lazy(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ ReportCollection

Lists report records by Product.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    which provide lazy access to pages of the



1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1991

def list_by_product_as_lazy(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  response = list_by_product_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_product_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_product_async(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by Product.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 552

def list_by_product_async(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'filter is nil' if filter.nil?
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'$orderby' => orderby,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_product_next(next_page_link, custom_headers: nil) ⇒ ReportCollection

Lists report records by Product.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    operation results.



1501
1502
1503
1504
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1501

def list_by_product_next(next_page_link, custom_headers:nil)
  response = list_by_product_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_product_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by Product.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1530

def list_by_product_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_product_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by Product.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1516
1517
1518
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1516

def list_by_product_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_product_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_product_with_http_info(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by Product.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



519
520
521
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 519

def list_by_product_with_http_info(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  list_by_product_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
end

#list_by_request(resource_group_name, service_name, filter, top: nil, skip: nil, custom_headers: nil) ⇒ RequestReportCollection

Lists report records by Request.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| subscriptionId | filter | eq | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

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

    A hash of custom headers that

Returns:

  • (RequestReportCollection)

    operation results.



1113
1114
1115
1116
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1113

def list_by_request(resource_group_name, service_name, filter, top:nil, skip:nil, custom_headers:nil)
  response = list_by_request_async(resource_group_name, service_name, filter, top:top, skip:skip, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_request_async(resource_group_name, service_name, filter, top: nil, skip: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by Request.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| subscriptionId | filter | eq | | </br> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1160

def list_by_request_async(resource_group_name, service_name, filter, top:nil, skip:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'filter is nil' if filter.nil?
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::RequestReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_request_with_http_info(resource_group_name, service_name, filter, top: nil, skip: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by Request.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| subscriptionId | filter | eq | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1137
1138
1139
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1137

def list_by_request_with_http_info(resource_group_name, service_name, filter, top:nil, skip:nil, custom_headers:nil)
  list_by_request_async(resource_group_name, service_name, filter, top:top, skip:skip, custom_headers:custom_headers).value!
end

#list_by_subscription(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Array<ReportRecordContract>

Lists report records by subscription.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (Array<ReportRecordContract>)

    operation results.



796
797
798
799
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 796

def list_by_subscription(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  first_page = list_by_subscription_as_lazy(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_subscription_as_lazy(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ ReportCollection

Lists report records by subscription.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    which provide lazy access to pages of the



2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 2072

def list_by_subscription_as_lazy(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  response = list_by_subscription_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_subscription_async(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by subscription.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 863

def list_by_subscription_async(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'filter is nil' if filter.nil?
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'$orderby' => orderby,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_next(next_page_link, custom_headers: nil) ⇒ ReportCollection

Lists report records by subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    operation results.



1681
1682
1683
1684
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1681

def list_by_subscription_next(next_page_link, custom_headers:nil)
  response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_subscription_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1710

def list_by_subscription_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1696
1697
1698
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1696

def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_subscription_with_http_info(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by subscription.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



830
831
832
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 830

def list_by_subscription_with_http_info(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  list_by_subscription_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
end

#list_by_time(resource_group_name, service_name, filter, interval, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Array<ReportRecordContract>

Lists report records by Time.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter, select | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> minutes and may not be zero. The value should be in ISO 8601 format (en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • interval (Duration)

    By time interval. Interval must be multiple of 15

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (Array<ReportRecordContract>)

    operation results.



957
958
959
960
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 957

def list_by_time(resource_group_name, service_name, filter, interval, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  first_page = list_by_time_as_lazy(resource_group_name, service_name, filter, interval, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_time_as_lazy(resource_group_name, service_name, filter, interval, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ ReportCollection

Lists report records by Time.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter, select | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> minutes and may not be zero. The value should be in ISO 8601 format (en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • interval (Duration)

    By time interval. Interval must be multiple of 15

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    which provide lazy access to pages of the



2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 2117

def list_by_time_as_lazy(resource_group_name, service_name, filter, interval, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  response = list_by_time_async(resource_group_name, service_name, filter, interval, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_time_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_time_async(resource_group_name, service_name, filter, interval, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by Time.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter, select | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> minutes and may not be zero. The value should be in ISO 8601 format (en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • interval (Duration)

    By time interval. Interval must be multiple of 15

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1032

def list_by_time_async(resource_group_name, service_name, filter, interval, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'filter is nil' if filter.nil?
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, 'interval is nil' if interval.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'$orderby' => orderby,'interval' => interval,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_time_next(next_page_link, custom_headers: nil) ⇒ ReportCollection

Lists report records by Time.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    operation results.



1771
1772
1773
1774
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1771

def list_by_time_next(next_page_link, custom_headers:nil)
  response = list_by_time_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_time_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by Time.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1800

def list_by_time_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_time_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by Time.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1786
1787
1788
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1786

def list_by_time_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_time_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_time_with_http_info(resource_group_name, service_name, filter, interval, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by Time.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter, select | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> minutes and may not be zero. The value should be in ISO 8601 format (en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • interval (Duration)

    By time interval. Interval must be multiple of 15

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



995
996
997
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 995

def list_by_time_with_http_info(resource_group_name, service_name, filter, interval, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  list_by_time_async(resource_group_name, service_name, filter, interval, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
end

#list_by_user(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Array<ReportRecordContract>

Lists report records by User.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (Array<ReportRecordContract>)

    operation results.



166
167
168
169
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 166

def list_by_user(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  first_page = list_by_user_as_lazy(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_user_as_lazy(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ ReportCollection

Lists report records by User.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    which provide lazy access to pages of the



1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1908

def list_by_user_as_lazy(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  response = list_by_user_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_user_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_user_async(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by User.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 235

def list_by_user_async(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'filter is nil' if filter.nil?
  fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'$skip' => skip,'$orderby' => orderby,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_user_next(next_page_link, custom_headers: nil) ⇒ ReportCollection

Lists report records by User.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ReportCollection)

    operation results.



1321
1322
1323
1324
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1321

def list_by_user_next(next_page_link, custom_headers:nil)
  response = list_by_user_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_user_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists report records by User.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1350

def list_by_user_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ApiManagement::Mgmt::V2019_01_01::Models::ReportCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_user_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by User.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1336
1337
1338
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 1336

def list_by_user_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_user_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_user_with_http_info(resource_group_name, service_name, filter, top: nil, skip: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists report records by User.

operators | Supported functions |</br>|————-|————-|————-|————-|</br>| timestamp | filter | ge, le | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • filter (String)

    | Field | Usage | Supported

  • top (Integer) (defaults to: nil)

    Number of records to return.

  • skip (Integer) (defaults to: nil)

    Number of records to skip.

  • orderby (String) (defaults to: nil)

    OData order by query option.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



201
202
203
# File 'lib/2019-01-01/generated/azure_mgmt_api_management/reports.rb', line 201

def list_by_user_with_http_info(resource_group_name, service_name, filter, top:nil, skip:nil, orderby:nil, custom_headers:nil)
  list_by_user_async(resource_group_name, service_name, filter, top:top, skip:skip, orderby:orderby, custom_headers:custom_headers).value!
end