azure_mgmt_consumption 0.15.1 → 0.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/consumption_management_client.rb +1 -3
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/error_details.rb +4 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/error_response.rb +2 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/meter_details.rb +8 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/operation.rb +3 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/operation_display.rb +4 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/operation_list_result.rb +4 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/resource.rb +6 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/usage_detail.rb +22 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/models/usage_details_list_result.rb +4 -0
- data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/usage_details.rb +2 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption.rb +38 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/consumption_management_client.rb +132 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/error_details.rb +59 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/error_response.rb +48 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/meter_details.rb +122 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/operation.rb +59 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/operation_display.rb +72 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/operation_list_result.rb +103 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/resource.rb +91 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/usage_detail.rb +355 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/models/usage_details_list_result.rb +101 -0
- data/lib/{2017-04-24-preview/generated/azure_mgmt_consumption/version.rb → 2017-11-30/generated/azure_mgmt_consumption/module_definition.rb} +4 -3
- data/lib/2017-11-30/generated/azure_mgmt_consumption/operations.rb +214 -0
- data/lib/2017-11-30/generated/azure_mgmt_consumption/usage_details.rb +301 -0
- data/lib/azure_mgmt_consumption.rb +1 -0
- data/lib/profiles/latest/consumption_latest_profile_client.rb +1 -3
- data/lib/profiles/latest/modules/consumption_profile_module.rb +21 -21
- data/lib/version.rb +1 -1
- metadata +24 -8
- data/lib/profiles/common/configurable.rb +0 -86
- data/lib/profiles/common/default.rb +0 -57
@@ -119,6 +119,8 @@ module Azure::Consumption::Mgmt::V2017_04_24_preview
|
|
119
119
|
#
|
120
120
|
def list_async(scope, expand = nil, filter = nil, skiptoken = nil, top = nil, custom_headers = nil)
|
121
121
|
fail ArgumentError, 'scope is nil' if scope.nil?
|
122
|
+
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
|
123
|
+
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
|
122
124
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
123
125
|
|
124
126
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '2017-11-30/generated/azure_mgmt_consumption/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::Consumption::Mgmt::V2017_11_30
|
23
|
+
autoload :UsageDetails, '2017-11-30/generated/azure_mgmt_consumption/usage_details.rb'
|
24
|
+
autoload :Operations, '2017-11-30/generated/azure_mgmt_consumption/operations.rb'
|
25
|
+
autoload :ConsumptionManagementClient, '2017-11-30/generated/azure_mgmt_consumption/consumption_management_client.rb'
|
26
|
+
|
27
|
+
module Models
|
28
|
+
autoload :ErrorResponse, '2017-11-30/generated/azure_mgmt_consumption/models/error_response.rb'
|
29
|
+
autoload :OperationDisplay, '2017-11-30/generated/azure_mgmt_consumption/models/operation_display.rb'
|
30
|
+
autoload :UsageDetailsListResult, '2017-11-30/generated/azure_mgmt_consumption/models/usage_details_list_result.rb'
|
31
|
+
autoload :Operation, '2017-11-30/generated/azure_mgmt_consumption/models/operation.rb'
|
32
|
+
autoload :MeterDetails, '2017-11-30/generated/azure_mgmt_consumption/models/meter_details.rb'
|
33
|
+
autoload :OperationListResult, '2017-11-30/generated/azure_mgmt_consumption/models/operation_list_result.rb'
|
34
|
+
autoload :ErrorDetails, '2017-11-30/generated/azure_mgmt_consumption/models/error_details.rb'
|
35
|
+
autoload :Resource, '2017-11-30/generated/azure_mgmt_consumption/models/resource.rb'
|
36
|
+
autoload :UsageDetail, '2017-11-30/generated/azure_mgmt_consumption/models/usage_detail.rb'
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Consumption::Mgmt::V2017_11_30
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class ConsumptionManagementClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return [String] Version of the API to be used with the client request.
|
21
|
+
# The current version is 2017-11-30.
|
22
|
+
attr_reader :api_version
|
23
|
+
|
24
|
+
# @return [String] Azure Subscription ID.
|
25
|
+
attr_accessor :subscription_id
|
26
|
+
|
27
|
+
# @return [String] Gets or sets the preferred language for the response.
|
28
|
+
attr_accessor :accept_language
|
29
|
+
|
30
|
+
# @return [Integer] Gets or sets the retry timeout in seconds for Long
|
31
|
+
# Running Operations. Default value is 30.
|
32
|
+
attr_accessor :long_running_operation_retry_timeout
|
33
|
+
|
34
|
+
# @return [Boolean] When set to true a unique x-ms-client-request-id value
|
35
|
+
# is generated and included in each request. Default is true.
|
36
|
+
attr_accessor :generate_client_request_id
|
37
|
+
|
38
|
+
# @return [UsageDetails] usage_details
|
39
|
+
attr_reader :usage_details
|
40
|
+
|
41
|
+
# @return [Operations] operations
|
42
|
+
attr_reader :operations
|
43
|
+
|
44
|
+
#
|
45
|
+
# Creates initializes a new instance of the ConsumptionManagementClient class.
|
46
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
47
|
+
# @param base_url [String] the base URI of the service.
|
48
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
49
|
+
#
|
50
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
51
|
+
super(credentials, options)
|
52
|
+
@base_url = base_url || 'https://management.azure.com'
|
53
|
+
|
54
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
55
|
+
@credentials = credentials
|
56
|
+
|
57
|
+
@usage_details = UsageDetails.new(self)
|
58
|
+
@operations = Operations.new(self)
|
59
|
+
@api_version = '2017-11-30'
|
60
|
+
@accept_language = 'en-US'
|
61
|
+
@long_running_operation_retry_timeout = 30
|
62
|
+
@generate_client_request_id = true
|
63
|
+
add_telemetry
|
64
|
+
end
|
65
|
+
|
66
|
+
#
|
67
|
+
# Makes a request and returns the body of the response.
|
68
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
69
|
+
# @param path [String] the path, relative to {base_url}.
|
70
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
71
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
72
|
+
# Example:
|
73
|
+
#
|
74
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
75
|
+
# path = "/path"
|
76
|
+
# options = {
|
77
|
+
# body: request_content,
|
78
|
+
# query_params: {'api-version' => '2016-02-01'}
|
79
|
+
# }
|
80
|
+
# result = @client.make_request(:put, path, options)
|
81
|
+
#
|
82
|
+
def make_request(method, path, options = {})
|
83
|
+
result = make_request_with_http_info(method, path, options)
|
84
|
+
result.body unless result.nil?
|
85
|
+
end
|
86
|
+
|
87
|
+
#
|
88
|
+
# Makes a request and returns the operation response.
|
89
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
90
|
+
# @param path [String] the path, relative to {base_url}.
|
91
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
92
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
93
|
+
#
|
94
|
+
def make_request_with_http_info(method, path, options = {})
|
95
|
+
result = make_request_async(method, path, options).value!
|
96
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
97
|
+
result
|
98
|
+
end
|
99
|
+
|
100
|
+
#
|
101
|
+
# Makes a request asynchronously.
|
102
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
103
|
+
# @param path [String] the path, relative to {base_url}.
|
104
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
105
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
106
|
+
#
|
107
|
+
def make_request_async(method, path, options = {})
|
108
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
109
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
110
|
+
|
111
|
+
request_url = options[:base_url] || @base_url
|
112
|
+
|
113
|
+
request_headers = @request_headers
|
114
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
115
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
116
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
117
|
+
|
118
|
+
super(request_url, method, path, options)
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
private
|
123
|
+
#
|
124
|
+
# Adds telemetry information.
|
125
|
+
#
|
126
|
+
def add_telemetry
|
127
|
+
sdk_information = 'azure_mgmt_consumption'
|
128
|
+
sdk_information = "#{sdk_information}/0.15.2"
|
129
|
+
add_user_agent_information(sdk_information)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Consumption::Mgmt::V2017_11_30
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# The details of the error.
|
10
|
+
#
|
11
|
+
class ErrorDetails
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Error code.
|
16
|
+
attr_accessor :code
|
17
|
+
|
18
|
+
# @return [String] Error message indicating why the operation failed.
|
19
|
+
attr_accessor :message
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Mapper for ErrorDetails class as Ruby Hash.
|
24
|
+
# This will be used for serialization/deserialization.
|
25
|
+
#
|
26
|
+
def self.mapper()
|
27
|
+
{
|
28
|
+
client_side_validation: true,
|
29
|
+
required: false,
|
30
|
+
serialized_name: 'ErrorDetails',
|
31
|
+
type: {
|
32
|
+
name: 'Composite',
|
33
|
+
class_name: 'ErrorDetails',
|
34
|
+
model_properties: {
|
35
|
+
code: {
|
36
|
+
client_side_validation: true,
|
37
|
+
required: false,
|
38
|
+
read_only: true,
|
39
|
+
serialized_name: 'code',
|
40
|
+
type: {
|
41
|
+
name: 'String'
|
42
|
+
}
|
43
|
+
},
|
44
|
+
message: {
|
45
|
+
client_side_validation: true,
|
46
|
+
required: false,
|
47
|
+
read_only: true,
|
48
|
+
serialized_name: 'message',
|
49
|
+
type: {
|
50
|
+
name: 'String'
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Consumption::Mgmt::V2017_11_30
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Error response indicates that the service is not able to process the
|
10
|
+
# incoming request. The reason is provided in the error message.
|
11
|
+
#
|
12
|
+
class ErrorResponse
|
13
|
+
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
# @return [ErrorDetails] The details of the error.
|
17
|
+
attr_accessor :error
|
18
|
+
|
19
|
+
|
20
|
+
#
|
21
|
+
# Mapper for ErrorResponse class as Ruby Hash.
|
22
|
+
# This will be used for serialization/deserialization.
|
23
|
+
#
|
24
|
+
def self.mapper()
|
25
|
+
{
|
26
|
+
client_side_validation: true,
|
27
|
+
required: false,
|
28
|
+
serialized_name: 'ErrorResponse',
|
29
|
+
type: {
|
30
|
+
name: 'Composite',
|
31
|
+
class_name: 'ErrorResponse',
|
32
|
+
model_properties: {
|
33
|
+
error: {
|
34
|
+
client_side_validation: true,
|
35
|
+
required: false,
|
36
|
+
serialized_name: 'error',
|
37
|
+
type: {
|
38
|
+
name: 'Composite',
|
39
|
+
class_name: 'ErrorDetails'
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Consumption::Mgmt::V2017_11_30
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# The properties of the meter detail.
|
10
|
+
#
|
11
|
+
class MeterDetails
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The name of the meter, within the given meter category
|
16
|
+
attr_accessor :meter_name
|
17
|
+
|
18
|
+
# @return [String] The category of the meter, for example, 'Cloud
|
19
|
+
# services', 'Networking', etc..
|
20
|
+
attr_accessor :meter_category
|
21
|
+
|
22
|
+
# @return [String] The subcategory of the meter, for example, 'A6 Cloud
|
23
|
+
# services', 'ExpressRoute (IXP)', etc..
|
24
|
+
attr_accessor :meter_sub_category
|
25
|
+
|
26
|
+
# @return [String] The unit in which the meter consumption is charged,
|
27
|
+
# for example, 'Hours', 'GB', etc.
|
28
|
+
attr_accessor :unit
|
29
|
+
|
30
|
+
# @return [String] The location in which the Azure service is available.
|
31
|
+
attr_accessor :meter_location
|
32
|
+
|
33
|
+
# @return The total included quantity associated with the offer.
|
34
|
+
attr_accessor :total_included_quantity
|
35
|
+
|
36
|
+
# @return The pretax listing price.
|
37
|
+
attr_accessor :pretax_standard_rate
|
38
|
+
|
39
|
+
|
40
|
+
#
|
41
|
+
# Mapper for MeterDetails class as Ruby Hash.
|
42
|
+
# This will be used for serialization/deserialization.
|
43
|
+
#
|
44
|
+
def self.mapper()
|
45
|
+
{
|
46
|
+
client_side_validation: true,
|
47
|
+
required: false,
|
48
|
+
serialized_name: 'MeterDetails',
|
49
|
+
type: {
|
50
|
+
name: 'Composite',
|
51
|
+
class_name: 'MeterDetails',
|
52
|
+
model_properties: {
|
53
|
+
meter_name: {
|
54
|
+
client_side_validation: true,
|
55
|
+
required: false,
|
56
|
+
read_only: true,
|
57
|
+
serialized_name: 'meterName',
|
58
|
+
type: {
|
59
|
+
name: 'String'
|
60
|
+
}
|
61
|
+
},
|
62
|
+
meter_category: {
|
63
|
+
client_side_validation: true,
|
64
|
+
required: false,
|
65
|
+
read_only: true,
|
66
|
+
serialized_name: 'meterCategory',
|
67
|
+
type: {
|
68
|
+
name: 'String'
|
69
|
+
}
|
70
|
+
},
|
71
|
+
meter_sub_category: {
|
72
|
+
client_side_validation: true,
|
73
|
+
required: false,
|
74
|
+
read_only: true,
|
75
|
+
serialized_name: 'meterSubCategory',
|
76
|
+
type: {
|
77
|
+
name: 'String'
|
78
|
+
}
|
79
|
+
},
|
80
|
+
unit: {
|
81
|
+
client_side_validation: true,
|
82
|
+
required: false,
|
83
|
+
read_only: true,
|
84
|
+
serialized_name: 'unit',
|
85
|
+
type: {
|
86
|
+
name: 'String'
|
87
|
+
}
|
88
|
+
},
|
89
|
+
meter_location: {
|
90
|
+
client_side_validation: true,
|
91
|
+
required: false,
|
92
|
+
read_only: true,
|
93
|
+
serialized_name: 'meterLocation',
|
94
|
+
type: {
|
95
|
+
name: 'String'
|
96
|
+
}
|
97
|
+
},
|
98
|
+
total_included_quantity: {
|
99
|
+
client_side_validation: true,
|
100
|
+
required: false,
|
101
|
+
read_only: true,
|
102
|
+
serialized_name: 'totalIncludedQuantity',
|
103
|
+
type: {
|
104
|
+
name: 'Number'
|
105
|
+
}
|
106
|
+
},
|
107
|
+
pretax_standard_rate: {
|
108
|
+
client_side_validation: true,
|
109
|
+
required: false,
|
110
|
+
read_only: true,
|
111
|
+
serialized_name: 'pretaxStandardRate',
|
112
|
+
type: {
|
113
|
+
name: 'Number'
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Consumption::Mgmt::V2017_11_30
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# A Consumption REST API operation.
|
10
|
+
#
|
11
|
+
class Operation
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Operation name: {provider}/{resource}/{operation}.
|
16
|
+
attr_accessor :name
|
17
|
+
|
18
|
+
# @return [OperationDisplay] The object that represents the operation.
|
19
|
+
attr_accessor :display
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Mapper for Operation class as Ruby Hash.
|
24
|
+
# This will be used for serialization/deserialization.
|
25
|
+
#
|
26
|
+
def self.mapper()
|
27
|
+
{
|
28
|
+
client_side_validation: true,
|
29
|
+
required: false,
|
30
|
+
serialized_name: 'Operation',
|
31
|
+
type: {
|
32
|
+
name: 'Composite',
|
33
|
+
class_name: 'Operation',
|
34
|
+
model_properties: {
|
35
|
+
name: {
|
36
|
+
client_side_validation: true,
|
37
|
+
required: false,
|
38
|
+
read_only: true,
|
39
|
+
serialized_name: 'name',
|
40
|
+
type: {
|
41
|
+
name: 'String'
|
42
|
+
}
|
43
|
+
},
|
44
|
+
display: {
|
45
|
+
client_side_validation: true,
|
46
|
+
required: false,
|
47
|
+
serialized_name: 'display',
|
48
|
+
type: {
|
49
|
+
name: 'Composite',
|
50
|
+
class_name: 'OperationDisplay'
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|