azure_mgmt_maintenance 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance.rb +48 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/apply_updates.rb +481 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/configuration_assignments.rb +747 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/maintenance_configurations.rb +509 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/maintenance_management_client.rb +149 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/apply_update.rb +96 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/configuration_assignment.rb +95 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/error_details.rb +58 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/impact_type.rb +18 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_configuration_assignments_result.rb +56 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_maintenance_configurations_result.rb +56 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_updates_result.rb +55 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_configuration.rb +136 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_error.rb +47 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_scope.rb +18 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/operation.rb +80 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/operation_info.rb +79 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/operations_list_result.rb +55 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/resource.rb +80 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/update.rb +105 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/update_status.rb +19 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/module_definition.rb +9 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/operations.rb +118 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/updates.rb +249 -0
- data/lib/azure_mgmt_maintenance.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/maintenance_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/maintenance_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/maintenance_profile_module.rb +133 -0
- data/lib/version.rb +7 -0
- metadata +148 -0
@@ -0,0 +1,55 @@
|
|
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::Maintenance::Mgmt::V2018_06_01_preview
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Result of the List Operations operation
|
10
|
+
#
|
11
|
+
class OperationsListResult
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [Array<Operation>] A collection of operations
|
16
|
+
attr_accessor :value
|
17
|
+
|
18
|
+
|
19
|
+
#
|
20
|
+
# Mapper for OperationsListResult class as Ruby Hash.
|
21
|
+
# This will be used for serialization/deserialization.
|
22
|
+
#
|
23
|
+
def self.mapper()
|
24
|
+
{
|
25
|
+
client_side_validation: true,
|
26
|
+
required: false,
|
27
|
+
serialized_name: 'OperationsListResult',
|
28
|
+
type: {
|
29
|
+
name: 'Composite',
|
30
|
+
class_name: 'OperationsListResult',
|
31
|
+
model_properties: {
|
32
|
+
value: {
|
33
|
+
client_side_validation: true,
|
34
|
+
required: false,
|
35
|
+
serialized_name: 'value',
|
36
|
+
type: {
|
37
|
+
name: 'Sequence',
|
38
|
+
element: {
|
39
|
+
client_side_validation: true,
|
40
|
+
required: false,
|
41
|
+
serialized_name: 'OperationElementType',
|
42
|
+
type: {
|
43
|
+
name: 'Composite',
|
44
|
+
class_name: 'Operation'
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,80 @@
|
|
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::Maintenance::Mgmt::V2018_06_01_preview
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Definition of a Resource
|
10
|
+
#
|
11
|
+
class Resource
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Fully qualified identifier of the resource
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
# @return [String] Name of the resource
|
19
|
+
attr_accessor :name
|
20
|
+
|
21
|
+
# @return [String] Type of the resource
|
22
|
+
attr_accessor :type
|
23
|
+
|
24
|
+
|
25
|
+
# @return [String] the name of the resource group of the resource.
|
26
|
+
def resource_group
|
27
|
+
unless self.id.nil?
|
28
|
+
groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/)
|
29
|
+
groups.captures[0].strip if groups
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
#
|
35
|
+
# Mapper for Resource class as Ruby Hash.
|
36
|
+
# This will be used for serialization/deserialization.
|
37
|
+
#
|
38
|
+
def self.mapper()
|
39
|
+
{
|
40
|
+
client_side_validation: true,
|
41
|
+
required: false,
|
42
|
+
serialized_name: 'Resource',
|
43
|
+
type: {
|
44
|
+
name: 'Composite',
|
45
|
+
class_name: 'Resource',
|
46
|
+
model_properties: {
|
47
|
+
id: {
|
48
|
+
client_side_validation: true,
|
49
|
+
required: false,
|
50
|
+
read_only: true,
|
51
|
+
serialized_name: 'id',
|
52
|
+
type: {
|
53
|
+
name: 'String'
|
54
|
+
}
|
55
|
+
},
|
56
|
+
name: {
|
57
|
+
client_side_validation: true,
|
58
|
+
required: false,
|
59
|
+
read_only: true,
|
60
|
+
serialized_name: 'name',
|
61
|
+
type: {
|
62
|
+
name: 'String'
|
63
|
+
}
|
64
|
+
},
|
65
|
+
type: {
|
66
|
+
client_side_validation: true,
|
67
|
+
required: false,
|
68
|
+
read_only: true,
|
69
|
+
serialized_name: 'type',
|
70
|
+
type: {
|
71
|
+
name: 'String'
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,105 @@
|
|
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::Maintenance::Mgmt::V2018_06_01_preview
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Maintenance update on a resource
|
10
|
+
#
|
11
|
+
class Update
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [MaintenanceScope] The impact area. Possible values include:
|
16
|
+
# 'All', 'Host', 'Resource', 'InResource'
|
17
|
+
attr_accessor :maintenance_scope
|
18
|
+
|
19
|
+
# @return [ImpactType] The impact type. Possible values include: 'None',
|
20
|
+
# 'Freeze', 'Restart', 'Redeploy'
|
21
|
+
attr_accessor :impact_type
|
22
|
+
|
23
|
+
# @return [UpdateStatus] The status. Possible values include: 'Pending',
|
24
|
+
# 'InProgress', 'Completed', 'RetryNow', 'RetryLater'
|
25
|
+
attr_accessor :status
|
26
|
+
|
27
|
+
# @return [Integer] Duration of impact in seconds
|
28
|
+
attr_accessor :impact_duration_in_sec
|
29
|
+
|
30
|
+
# @return [DateTime] Time when Azure will start force updates if not
|
31
|
+
# self-updated by customer before this time
|
32
|
+
attr_accessor :not_before
|
33
|
+
|
34
|
+
# @return [String] The resourceId
|
35
|
+
attr_accessor :resource_id
|
36
|
+
|
37
|
+
|
38
|
+
#
|
39
|
+
# Mapper for Update class as Ruby Hash.
|
40
|
+
# This will be used for serialization/deserialization.
|
41
|
+
#
|
42
|
+
def self.mapper()
|
43
|
+
{
|
44
|
+
client_side_validation: true,
|
45
|
+
required: false,
|
46
|
+
serialized_name: 'Update',
|
47
|
+
type: {
|
48
|
+
name: 'Composite',
|
49
|
+
class_name: 'Update',
|
50
|
+
model_properties: {
|
51
|
+
maintenance_scope: {
|
52
|
+
client_side_validation: true,
|
53
|
+
required: false,
|
54
|
+
serialized_name: 'maintenanceScope',
|
55
|
+
type: {
|
56
|
+
name: 'String'
|
57
|
+
}
|
58
|
+
},
|
59
|
+
impact_type: {
|
60
|
+
client_side_validation: true,
|
61
|
+
required: false,
|
62
|
+
serialized_name: 'impactType',
|
63
|
+
type: {
|
64
|
+
name: 'String'
|
65
|
+
}
|
66
|
+
},
|
67
|
+
status: {
|
68
|
+
client_side_validation: true,
|
69
|
+
required: false,
|
70
|
+
serialized_name: 'status',
|
71
|
+
type: {
|
72
|
+
name: 'String'
|
73
|
+
}
|
74
|
+
},
|
75
|
+
impact_duration_in_sec: {
|
76
|
+
client_side_validation: true,
|
77
|
+
required: false,
|
78
|
+
serialized_name: 'impactDurationInSec',
|
79
|
+
type: {
|
80
|
+
name: 'Number'
|
81
|
+
}
|
82
|
+
},
|
83
|
+
not_before: {
|
84
|
+
client_side_validation: true,
|
85
|
+
required: false,
|
86
|
+
serialized_name: 'notBefore',
|
87
|
+
type: {
|
88
|
+
name: 'DateTime'
|
89
|
+
}
|
90
|
+
},
|
91
|
+
resource_id: {
|
92
|
+
client_side_validation: true,
|
93
|
+
required: false,
|
94
|
+
serialized_name: 'properties.resourceId',
|
95
|
+
type: {
|
96
|
+
name: 'String'
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,19 @@
|
|
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::Maintenance::Mgmt::V2018_06_01_preview
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Defines values for UpdateStatus
|
10
|
+
#
|
11
|
+
module UpdateStatus
|
12
|
+
Pending = "Pending"
|
13
|
+
InProgress = "InProgress"
|
14
|
+
Completed = "Completed"
|
15
|
+
RetryNow = "RetryNow"
|
16
|
+
RetryLater = "RetryLater"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,9 @@
|
|
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 end
|
7
|
+
module Azure::Maintenance end
|
8
|
+
module Azure::Maintenance::Mgmt end
|
9
|
+
module Azure::Maintenance::Mgmt::V2018_06_01_preview end
|
@@ -0,0 +1,118 @@
|
|
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::Maintenance::Mgmt::V2018_06_01_preview
|
7
|
+
#
|
8
|
+
# Azure Maintenance Management Client
|
9
|
+
#
|
10
|
+
class Operations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Operations class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [MaintenanceManagementClient] reference to the MaintenanceManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# List available operations
|
26
|
+
#
|
27
|
+
# List the available operations supported by the Microsoft.Maintenance resource
|
28
|
+
# provider
|
29
|
+
#
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
31
|
+
# will be added to the HTTP request.
|
32
|
+
#
|
33
|
+
# @return [OperationsListResult] operation results.
|
34
|
+
#
|
35
|
+
def list(custom_headers:nil)
|
36
|
+
response = list_async(custom_headers:custom_headers).value!
|
37
|
+
response.body unless response.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# List available operations
|
42
|
+
#
|
43
|
+
# List the available operations supported by the Microsoft.Maintenance resource
|
44
|
+
# provider
|
45
|
+
#
|
46
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
47
|
+
# will be added to the HTTP request.
|
48
|
+
#
|
49
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
50
|
+
#
|
51
|
+
def list_with_http_info(custom_headers:nil)
|
52
|
+
list_async(custom_headers:custom_headers).value!
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# List available operations
|
57
|
+
#
|
58
|
+
# List the available operations supported by the Microsoft.Maintenance resource
|
59
|
+
# provider
|
60
|
+
#
|
61
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
62
|
+
# to the HTTP request.
|
63
|
+
#
|
64
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
65
|
+
#
|
66
|
+
def list_async(custom_headers:nil)
|
67
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
68
|
+
|
69
|
+
|
70
|
+
request_headers = {}
|
71
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
72
|
+
|
73
|
+
# Set Headers
|
74
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
75
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
76
|
+
path_template = 'providers/Microsoft.Maintenance/operations'
|
77
|
+
|
78
|
+
request_url = @base_url || @client.base_url
|
79
|
+
|
80
|
+
options = {
|
81
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
82
|
+
query_params: {'api-version' => @client.api_version},
|
83
|
+
headers: request_headers.merge(custom_headers || {}),
|
84
|
+
base_url: request_url
|
85
|
+
}
|
86
|
+
promise = @client.make_request_async(:get, path_template, options)
|
87
|
+
|
88
|
+
promise = promise.then do |result|
|
89
|
+
http_response = result.response
|
90
|
+
status_code = http_response.status
|
91
|
+
response_content = http_response.body
|
92
|
+
unless status_code == 200
|
93
|
+
error_model = JSON.load(response_content)
|
94
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
95
|
+
end
|
96
|
+
|
97
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
98
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
99
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
100
|
+
# Deserialize Response
|
101
|
+
if status_code == 200
|
102
|
+
begin
|
103
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
104
|
+
result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::OperationsListResult.mapper()
|
105
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
106
|
+
rescue Exception => e
|
107
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
result
|
112
|
+
end
|
113
|
+
|
114
|
+
promise.execute
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,249 @@
|
|
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::Maintenance::Mgmt::V2018_06_01_preview
|
7
|
+
#
|
8
|
+
# Azure Maintenance Management Client
|
9
|
+
#
|
10
|
+
class Updates
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Updates class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [MaintenanceManagementClient] reference to the MaintenanceManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Get Updates to resource
|
26
|
+
#
|
27
|
+
# Get updates to resources.
|
28
|
+
#
|
29
|
+
# @param resource_group_name [String] Resource group name
|
30
|
+
# @param provider_name [String] Resource provider name
|
31
|
+
# @param resource_parent_type [String] Resource parent type
|
32
|
+
# @param resource_parent_name [String] Resource parent identifier
|
33
|
+
# @param resource_type [String] Resource type
|
34
|
+
# @param resource_name [String] Resource identifier
|
35
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
36
|
+
# will be added to the HTTP request.
|
37
|
+
#
|
38
|
+
# @return [ListUpdatesResult] operation results.
|
39
|
+
#
|
40
|
+
def list_parent(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:nil)
|
41
|
+
response = list_parent_async(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:custom_headers).value!
|
42
|
+
response.body unless response.nil?
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# Get Updates to resource
|
47
|
+
#
|
48
|
+
# Get updates to resources.
|
49
|
+
#
|
50
|
+
# @param resource_group_name [String] Resource group name
|
51
|
+
# @param provider_name [String] Resource provider name
|
52
|
+
# @param resource_parent_type [String] Resource parent type
|
53
|
+
# @param resource_parent_name [String] Resource parent identifier
|
54
|
+
# @param resource_type [String] Resource type
|
55
|
+
# @param resource_name [String] Resource identifier
|
56
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
57
|
+
# will be added to the HTTP request.
|
58
|
+
#
|
59
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
60
|
+
#
|
61
|
+
def list_parent_with_http_info(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:nil)
|
62
|
+
list_parent_async(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:custom_headers).value!
|
63
|
+
end
|
64
|
+
|
65
|
+
#
|
66
|
+
# Get Updates to resource
|
67
|
+
#
|
68
|
+
# Get updates to resources.
|
69
|
+
#
|
70
|
+
# @param resource_group_name [String] Resource group name
|
71
|
+
# @param provider_name [String] Resource provider name
|
72
|
+
# @param resource_parent_type [String] Resource parent type
|
73
|
+
# @param resource_parent_name [String] Resource parent identifier
|
74
|
+
# @param resource_type [String] Resource type
|
75
|
+
# @param resource_name [String] Resource identifier
|
76
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
77
|
+
# to the HTTP request.
|
78
|
+
#
|
79
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
80
|
+
#
|
81
|
+
def list_parent_async(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:nil)
|
82
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
83
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
84
|
+
fail ArgumentError, 'provider_name is nil' if provider_name.nil?
|
85
|
+
fail ArgumentError, 'resource_parent_type is nil' if resource_parent_type.nil?
|
86
|
+
fail ArgumentError, 'resource_parent_name is nil' if resource_parent_name.nil?
|
87
|
+
fail ArgumentError, 'resource_type is nil' if resource_type.nil?
|
88
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
89
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
90
|
+
|
91
|
+
|
92
|
+
request_headers = {}
|
93
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
94
|
+
|
95
|
+
# Set Headers
|
96
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
97
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
98
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates'
|
99
|
+
|
100
|
+
request_url = @base_url || @client.base_url
|
101
|
+
|
102
|
+
options = {
|
103
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
104
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerName' => provider_name,'resourceParentType' => resource_parent_type,'resourceParentName' => resource_parent_name,'resourceType' => resource_type,'resourceName' => resource_name},
|
105
|
+
query_params: {'api-version' => @client.api_version},
|
106
|
+
headers: request_headers.merge(custom_headers || {}),
|
107
|
+
base_url: request_url
|
108
|
+
}
|
109
|
+
promise = @client.make_request_async(:get, path_template, options)
|
110
|
+
|
111
|
+
promise = promise.then do |result|
|
112
|
+
http_response = result.response
|
113
|
+
status_code = http_response.status
|
114
|
+
response_content = http_response.body
|
115
|
+
unless status_code == 200
|
116
|
+
error_model = JSON.load(response_content)
|
117
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
118
|
+
end
|
119
|
+
|
120
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
121
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
122
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
123
|
+
# Deserialize Response
|
124
|
+
if status_code == 200
|
125
|
+
begin
|
126
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
127
|
+
result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::ListUpdatesResult.mapper()
|
128
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
129
|
+
rescue Exception => e
|
130
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
result
|
135
|
+
end
|
136
|
+
|
137
|
+
promise.execute
|
138
|
+
end
|
139
|
+
|
140
|
+
#
|
141
|
+
# Get Updates to resource
|
142
|
+
#
|
143
|
+
# Get updates to resources.
|
144
|
+
#
|
145
|
+
# @param resource_group_name [String] Resource group name
|
146
|
+
# @param provider_name [String] Resource provider name
|
147
|
+
# @param resource_type [String] Resource type
|
148
|
+
# @param resource_name [String] Resource identifier
|
149
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
150
|
+
# will be added to the HTTP request.
|
151
|
+
#
|
152
|
+
# @return [ListUpdatesResult] operation results.
|
153
|
+
#
|
154
|
+
def list(resource_group_name, provider_name, resource_type, resource_name, custom_headers:nil)
|
155
|
+
response = list_async(resource_group_name, provider_name, resource_type, resource_name, custom_headers:custom_headers).value!
|
156
|
+
response.body unless response.nil?
|
157
|
+
end
|
158
|
+
|
159
|
+
#
|
160
|
+
# Get Updates to resource
|
161
|
+
#
|
162
|
+
# Get updates to resources.
|
163
|
+
#
|
164
|
+
# @param resource_group_name [String] Resource group name
|
165
|
+
# @param provider_name [String] Resource provider name
|
166
|
+
# @param resource_type [String] Resource type
|
167
|
+
# @param resource_name [String] Resource identifier
|
168
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
169
|
+
# will be added to the HTTP request.
|
170
|
+
#
|
171
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
172
|
+
#
|
173
|
+
def list_with_http_info(resource_group_name, provider_name, resource_type, resource_name, custom_headers:nil)
|
174
|
+
list_async(resource_group_name, provider_name, resource_type, resource_name, custom_headers:custom_headers).value!
|
175
|
+
end
|
176
|
+
|
177
|
+
#
|
178
|
+
# Get Updates to resource
|
179
|
+
#
|
180
|
+
# Get updates to resources.
|
181
|
+
#
|
182
|
+
# @param resource_group_name [String] Resource group name
|
183
|
+
# @param provider_name [String] Resource provider name
|
184
|
+
# @param resource_type [String] Resource type
|
185
|
+
# @param resource_name [String] Resource identifier
|
186
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
187
|
+
# to the HTTP request.
|
188
|
+
#
|
189
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
190
|
+
#
|
191
|
+
def list_async(resource_group_name, provider_name, resource_type, resource_name, custom_headers:nil)
|
192
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
193
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
194
|
+
fail ArgumentError, 'provider_name is nil' if provider_name.nil?
|
195
|
+
fail ArgumentError, 'resource_type is nil' if resource_type.nil?
|
196
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
197
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
198
|
+
|
199
|
+
|
200
|
+
request_headers = {}
|
201
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
202
|
+
|
203
|
+
# Set Headers
|
204
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
205
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
206
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates'
|
207
|
+
|
208
|
+
request_url = @base_url || @client.base_url
|
209
|
+
|
210
|
+
options = {
|
211
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
212
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerName' => provider_name,'resourceType' => resource_type,'resourceName' => resource_name},
|
213
|
+
query_params: {'api-version' => @client.api_version},
|
214
|
+
headers: request_headers.merge(custom_headers || {}),
|
215
|
+
base_url: request_url
|
216
|
+
}
|
217
|
+
promise = @client.make_request_async(:get, path_template, options)
|
218
|
+
|
219
|
+
promise = promise.then do |result|
|
220
|
+
http_response = result.response
|
221
|
+
status_code = http_response.status
|
222
|
+
response_content = http_response.body
|
223
|
+
unless status_code == 200
|
224
|
+
error_model = JSON.load(response_content)
|
225
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
226
|
+
end
|
227
|
+
|
228
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
229
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
230
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
231
|
+
# Deserialize Response
|
232
|
+
if status_code == 200
|
233
|
+
begin
|
234
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
235
|
+
result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::ListUpdatesResult.mapper()
|
236
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
237
|
+
rescue Exception => e
|
238
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
result
|
243
|
+
end
|
244
|
+
|
245
|
+
promise.execute
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|
249
|
+
end
|