azure_mgmt_consumption 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/consumption_management_client.rb +4 -1
  3. data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/operations.rb +15 -13
  4. data/lib/2017-04-24-preview/generated/azure_mgmt_consumption/usage_details.rb +15 -13
  5. data/lib/2017-11-30/generated/azure_mgmt_consumption.rb +12 -5
  6. data/lib/2017-11-30/generated/azure_mgmt_consumption/consumption_management_client.rb +12 -1
  7. data/lib/2017-11-30/generated/azure_mgmt_consumption/models/datagrain.rb +16 -0
  8. data/lib/2017-11-30/generated/azure_mgmt_consumption/models/reservation_details.rb +187 -0
  9. data/lib/2017-11-30/generated/azure_mgmt_consumption/models/reservation_details_list_result.rb +56 -0
  10. data/lib/2017-11-30/generated/azure_mgmt_consumption/models/reservation_summaries.rb +205 -0
  11. data/lib/2017-11-30/generated/azure_mgmt_consumption/models/reservation_summaries_list_result.rb +57 -0
  12. data/lib/2017-11-30/generated/azure_mgmt_consumption/operations.rb +15 -13
  13. data/lib/2017-11-30/generated/azure_mgmt_consumption/reservations_details.rb +129 -0
  14. data/lib/2017-11-30/generated/azure_mgmt_consumption/reservations_summaries.rb +135 -0
  15. data/lib/2017-11-30/generated/azure_mgmt_consumption/usage_details.rb +15 -13
  16. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption.rb +42 -0
  17. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/budgets.rb +384 -0
  18. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/consumption_management_client.rb +138 -0
  19. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/budget.rb +160 -0
  20. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/budget_time_period.rb +58 -0
  21. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/budgets_list_result.rb +57 -0
  22. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/current_spend.rb +59 -0
  23. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/error_details.rb +59 -0
  24. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/error_response.rb +48 -0
  25. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/notification.rb +115 -0
  26. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/operation.rb +59 -0
  27. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/operation_display.rb +72 -0
  28. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/operation_list_result.rb +103 -0
  29. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/operator_type.rb +17 -0
  30. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/proxy_resource.rb +84 -0
  31. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/models/time_grain_type.rb +17 -0
  32. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/module_definition.rb +9 -0
  33. data/lib/2017-12-30-preview/generated/azure_mgmt_consumption/operations.rb +216 -0
  34. data/lib/2018-01-31/generated/azure_mgmt_consumption.rb +62 -0
  35. data/lib/2018-01-31/generated/azure_mgmt_consumption/budgets.rb +993 -0
  36. data/lib/2018-01-31/generated/azure_mgmt_consumption/consumption_management_client.rb +155 -0
  37. data/lib/2018-01-31/generated/azure_mgmt_consumption/marketplaces.rb +521 -0
  38. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/budget.rb +171 -0
  39. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/budget_time_period.rb +58 -0
  40. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/budgets_list_result.rb +101 -0
  41. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/category_type.rb +16 -0
  42. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/current_spend.rb +59 -0
  43. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/datagrain.rb +16 -0
  44. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/error_details.rb +59 -0
  45. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/error_response.rb +48 -0
  46. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/filters.rb +106 -0
  47. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/marketplace.rb +375 -0
  48. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/marketplaces_list_result.rb +101 -0
  49. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/meter_details.rb +122 -0
  50. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/notification.rb +139 -0
  51. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/operation.rb +59 -0
  52. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/operation_display.rb +72 -0
  53. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/operation_list_result.rb +103 -0
  54. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/operator_type.rb +17 -0
  55. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/price_sheet_properties.rb +134 -0
  56. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/price_sheet_result.rb +112 -0
  57. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/proxy_resource.rb +84 -0
  58. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/reservation_details.rb +187 -0
  59. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/reservation_details_list_result.rb +100 -0
  60. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/reservation_summaries.rb +205 -0
  61. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/reservation_summaries_list_result.rb +101 -0
  62. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/resource.rb +91 -0
  63. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/time_grain_type.rb +17 -0
  64. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/usage_detail.rb +355 -0
  65. data/lib/2018-01-31/generated/azure_mgmt_consumption/models/usage_details_list_result.rb +101 -0
  66. data/lib/2018-01-31/generated/azure_mgmt_consumption/module_definition.rb +9 -0
  67. data/lib/2018-01-31/generated/azure_mgmt_consumption/operations.rb +216 -0
  68. data/lib/2018-01-31/generated/azure_mgmt_consumption/price_sheet.rb +246 -0
  69. data/lib/2018-01-31/generated/azure_mgmt_consumption/reservations_details.rb +449 -0
  70. data/lib/2018-01-31/generated/azure_mgmt_consumption/reservations_summaries.rb +465 -0
  71. data/lib/2018-01-31/generated/azure_mgmt_consumption/usage_details.rb +553 -0
  72. data/lib/azure_mgmt_consumption.rb +2 -0
  73. data/lib/profiles/latest/consumption_latest_profile_client.rb +28 -9
  74. data/lib/profiles/latest/consumption_module_definition.rb +0 -1
  75. data/lib/profiles/latest/modules/consumption_profile_module.rb +153 -48
  76. data/lib/version.rb +1 -1
  77. metadata +65 -2
@@ -0,0 +1,138 @@
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_12_30_preview
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-12-30-preview.
22
+ attr_reader :api_version
23
+
24
+ # @return [String] Azure Subscription ID.
25
+ attr_accessor :subscription_id
26
+
27
+ # @return [String] Budget name.
28
+ attr_accessor :name
29
+
30
+ # @return [String] Gets or sets the preferred language for the response.
31
+ attr_accessor :accept_language
32
+
33
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
34
+ # Running Operations. Default value is 30.
35
+ attr_accessor :long_running_operation_retry_timeout
36
+
37
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
38
+ # is generated and included in each request. Default is true.
39
+ attr_accessor :generate_client_request_id
40
+
41
+ # @return [Budgets] budgets
42
+ attr_reader :budgets
43
+
44
+ # @return [Operations] operations
45
+ attr_reader :operations
46
+
47
+ #
48
+ # Creates initializes a new instance of the ConsumptionManagementClient class.
49
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
50
+ # @param base_url [String] the base URI of the service.
51
+ # @param options [Array] filters to be applied to the HTTP requests.
52
+ #
53
+ def initialize(credentials = nil, base_url = nil, options = nil)
54
+ super(credentials, options)
55
+ @base_url = base_url || 'https://management.azure.com'
56
+
57
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
58
+ @credentials = credentials
59
+
60
+ @budgets = Budgets.new(self)
61
+ @operations = Operations.new(self)
62
+ @api_version = '2017-12-30-preview'
63
+ @accept_language = 'en-US'
64
+ @long_running_operation_retry_timeout = 30
65
+ @generate_client_request_id = true
66
+ add_telemetry
67
+ end
68
+
69
+ #
70
+ # Makes a request and returns the body of the response.
71
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
72
+ # @param path [String] the path, relative to {base_url}.
73
+ # @param options [Hash{String=>String}] specifying any request options like :body.
74
+ # @return [Hash{String=>String}] containing the body of the response.
75
+ # Example:
76
+ #
77
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
78
+ # path = "/path"
79
+ # options = {
80
+ # body: request_content,
81
+ # query_params: {'api-version' => '2016-02-01'}
82
+ # }
83
+ # result = @client.make_request(:put, path, options)
84
+ #
85
+ def make_request(method, path, options = {})
86
+ result = make_request_with_http_info(method, path, options)
87
+ result.body unless result.nil?
88
+ end
89
+
90
+ #
91
+ # Makes a request and returns the operation response.
92
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
93
+ # @param path [String] the path, relative to {base_url}.
94
+ # @param options [Hash{String=>String}] specifying any request options like :body.
95
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
96
+ #
97
+ def make_request_with_http_info(method, path, options = {})
98
+ result = make_request_async(method, path, options).value!
99
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
100
+ result
101
+ end
102
+
103
+ #
104
+ # Makes a request asynchronously.
105
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
106
+ # @param path [String] the path, relative to {base_url}.
107
+ # @param options [Hash{String=>String}] specifying any request options like :body.
108
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
109
+ #
110
+ def make_request_async(method, path, options = {})
111
+ fail ArgumentError, 'method is nil' if method.nil?
112
+ fail ArgumentError, 'path is nil' if path.nil?
113
+
114
+ request_url = options[:base_url] || @base_url
115
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
116
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
117
+ end
118
+
119
+ request_headers = @request_headers
120
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
121
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
122
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
123
+
124
+ super(request_url, method, path, options)
125
+ end
126
+
127
+
128
+ private
129
+ #
130
+ # Adds telemetry information.
131
+ #
132
+ def add_telemetry
133
+ sdk_information = 'azure_mgmt_consumption'
134
+ sdk_information = "#{sdk_information}/0.16.0"
135
+ add_user_agent_information(sdk_information)
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,160 @@
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_12_30_preview
7
+ module Models
8
+ #
9
+ # A budget resource.
10
+ #
11
+ class Budget < ProxyResource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The category of the budget, whether the budget tracks
16
+ # cost or something else. Default value: 'Cost' .
17
+ attr_accessor :category
18
+
19
+ # @return The total amount of cost to track with the budget
20
+ attr_accessor :amount
21
+
22
+ # @return [TimeGrainType] The time covered by a budget. Tracking of the
23
+ # amount will be reset based on the time grain. Possible values include:
24
+ # 'Monthly', 'Quarterly', 'Annually'
25
+ attr_accessor :time_grain
26
+
27
+ # @return [BudgetTimePeriod] Has start and end date of the budget. The
28
+ # start date must be first of the month and should be less than the end
29
+ # date. Budget start date must be on or after June 1, 2017. Future start
30
+ # date should not be more than three months. Past start date should be
31
+ # selected within the timegrain preiod. There are no restrictions on the
32
+ # end date.
33
+ attr_accessor :time_period
34
+
35
+ # @return [CurrentSpend] The current amount of cost which is being
36
+ # tracked for a budget.
37
+ attr_accessor :current_spend
38
+
39
+ # @return [Hash{String => Notification}] Dictionary of notifications
40
+ # associated with the budget. Budget can have up to five notifications.
41
+ attr_accessor :notifications
42
+
43
+
44
+ #
45
+ # Mapper for Budget class as Ruby Hash.
46
+ # This will be used for serialization/deserialization.
47
+ #
48
+ def self.mapper()
49
+ {
50
+ client_side_validation: true,
51
+ required: false,
52
+ serialized_name: 'Budget',
53
+ type: {
54
+ name: 'Composite',
55
+ class_name: 'Budget',
56
+ model_properties: {
57
+ id: {
58
+ client_side_validation: true,
59
+ required: false,
60
+ read_only: true,
61
+ serialized_name: 'id',
62
+ type: {
63
+ name: 'String'
64
+ }
65
+ },
66
+ name: {
67
+ client_side_validation: true,
68
+ required: false,
69
+ read_only: true,
70
+ serialized_name: 'name',
71
+ type: {
72
+ name: 'String'
73
+ }
74
+ },
75
+ type: {
76
+ client_side_validation: true,
77
+ required: false,
78
+ read_only: true,
79
+ serialized_name: 'type',
80
+ type: {
81
+ name: 'String'
82
+ }
83
+ },
84
+ e_tag: {
85
+ client_side_validation: true,
86
+ required: false,
87
+ serialized_name: 'eTag',
88
+ type: {
89
+ name: 'String'
90
+ }
91
+ },
92
+ category: {
93
+ client_side_validation: true,
94
+ required: true,
95
+ is_constant: true,
96
+ serialized_name: 'properties.category',
97
+ default_value: 'Cost',
98
+ type: {
99
+ name: 'String'
100
+ }
101
+ },
102
+ amount: {
103
+ client_side_validation: true,
104
+ required: true,
105
+ serialized_name: 'properties.amount',
106
+ type: {
107
+ name: 'Number'
108
+ }
109
+ },
110
+ time_grain: {
111
+ client_side_validation: true,
112
+ required: true,
113
+ serialized_name: 'properties.timeGrain',
114
+ type: {
115
+ name: 'String'
116
+ }
117
+ },
118
+ time_period: {
119
+ client_side_validation: true,
120
+ required: true,
121
+ serialized_name: 'properties.timePeriod',
122
+ type: {
123
+ name: 'Composite',
124
+ class_name: 'BudgetTimePeriod'
125
+ }
126
+ },
127
+ current_spend: {
128
+ client_side_validation: true,
129
+ required: false,
130
+ read_only: true,
131
+ serialized_name: 'properties.currentSpend',
132
+ type: {
133
+ name: 'Composite',
134
+ class_name: 'CurrentSpend'
135
+ }
136
+ },
137
+ notifications: {
138
+ client_side_validation: true,
139
+ required: false,
140
+ serialized_name: 'properties.notifications',
141
+ type: {
142
+ name: 'Dictionary',
143
+ value: {
144
+ client_side_validation: true,
145
+ required: false,
146
+ serialized_name: 'NotificationElementType',
147
+ type: {
148
+ name: 'Composite',
149
+ class_name: 'Notification'
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ end
158
+ end
159
+ end
160
+ end
@@ -0,0 +1,58 @@
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_12_30_preview
7
+ module Models
8
+ #
9
+ # The start and end date for a budget.
10
+ #
11
+ class BudgetTimePeriod
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [DateTime] The start date for the budget.
16
+ attr_accessor :start_date
17
+
18
+ # @return [DateTime] The end date for the budget. If not provided, we
19
+ # default this to 10 years from the start date.
20
+ attr_accessor :end_date
21
+
22
+
23
+ #
24
+ # Mapper for BudgetTimePeriod class as Ruby Hash.
25
+ # This will be used for serialization/deserialization.
26
+ #
27
+ def self.mapper()
28
+ {
29
+ client_side_validation: true,
30
+ required: false,
31
+ serialized_name: 'BudgetTimePeriod',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'BudgetTimePeriod',
35
+ model_properties: {
36
+ start_date: {
37
+ client_side_validation: true,
38
+ required: true,
39
+ serialized_name: 'startDate',
40
+ type: {
41
+ name: 'DateTime'
42
+ }
43
+ },
44
+ end_date: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ serialized_name: 'endDate',
48
+ type: {
49
+ name: 'DateTime'
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,57 @@
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_12_30_preview
7
+ module Models
8
+ #
9
+ # Result of listing budgets. It contains a list of available budgets in the
10
+ # scope provided.
11
+ #
12
+ class BudgetsListResult
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [Array<Budget>] The list of budgets.
17
+ attr_accessor :value
18
+
19
+
20
+ #
21
+ # Mapper for BudgetsListResult 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: 'BudgetsListResult',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'BudgetsListResult',
32
+ model_properties: {
33
+ value: {
34
+ client_side_validation: true,
35
+ required: false,
36
+ read_only: true,
37
+ serialized_name: 'value',
38
+ type: {
39
+ name: 'Sequence',
40
+ element: {
41
+ client_side_validation: true,
42
+ required: false,
43
+ serialized_name: 'BudgetElementType',
44
+ type: {
45
+ name: 'Composite',
46
+ class_name: 'Budget'
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ end
55
+ end
56
+ end
57
+ 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_12_30_preview
7
+ module Models
8
+ #
9
+ # The current amount of cost which is being tracked for a budget.
10
+ #
11
+ class CurrentSpend
12
+
13
+ include MsRestAzure
14
+
15
+ # @return The total amount of cost which is being tracked by the budget.
16
+ attr_accessor :amount
17
+
18
+ # @return [String] The unit of measure for the budget amount.
19
+ attr_accessor :unit
20
+
21
+
22
+ #
23
+ # Mapper for CurrentSpend 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: 'CurrentSpend',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'CurrentSpend',
34
+ model_properties: {
35
+ amount: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ read_only: true,
39
+ serialized_name: 'amount',
40
+ type: {
41
+ name: 'Number'
42
+ }
43
+ },
44
+ unit: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'unit',
49
+ type: {
50
+ name: 'String'
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ end
57
+ end
58
+ end
59
+ end