azure_mgmt_policy_insights 0.17.7 → 0.17.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-09-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  3. data/lib/2017-10-17-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  4. data/lib/2017-12-12-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  5. data/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  6. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/policy_states_query_results.rb +43 -0
  7. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/query_options.rb +11 -0
  8. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  9. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/policy_states.rb +998 -32
  10. data/lib/2019-07-01/generated/azure_mgmt_policy_insights.rb +39 -0
  11. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/error_definition.rb +115 -0
  12. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/error_response.rb +47 -0
  13. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/query_options.rb +54 -0
  14. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation.rb +172 -0
  15. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_deployment.rb +124 -0
  16. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_deployment_summary.rb +75 -0
  17. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_deployments_list_result.rb +101 -0
  18. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_filters.rb +55 -0
  19. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_list_result.rb +100 -0
  20. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/resource_discovery_mode.rb +16 -0
  21. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/typed_error_info.rb +59 -0
  22. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/module_definition.rb +9 -0
  23. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/policy_insights_client.rb +131 -0
  24. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/remediations.rb +3294 -0
  25. data/lib/2019-10-01/generated/azure_mgmt_policy_insights.rb +18 -13
  26. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/component_event_details.rb +132 -0
  27. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/component_state_details.rb +109 -0
  28. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/expression_evaluation_details.rb +12 -0
  29. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_event.rb +416 -0
  30. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb +125 -0
  31. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_state.rb +21 -0
  32. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_states_query_results.rb +43 -0
  33. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/query_options.rb +12 -1
  34. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_events.rb +1961 -0
  35. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_insights_client.rb +5 -1
  36. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_states.rb +998 -32
  37. data/lib/azure_mgmt_policy_insights.rb +4 -3
  38. data/lib/profiles/latest/modules/policyinsights_profile_module.rb +23 -11
  39. data/lib/version.rb +1 -1
  40. metadata +23 -3
@@ -0,0 +1,75 @@
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::PolicyInsights::Mgmt::V2019_07_01
7
+ module Models
8
+ #
9
+ # The deployment status summary for all deployments created by the
10
+ # remediation.
11
+ #
12
+ class RemediationDeploymentSummary
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [Integer] The number of deployments required by the
17
+ # remediation.
18
+ attr_accessor :total_deployments
19
+
20
+ # @return [Integer] The number of deployments required by the remediation
21
+ # that have succeeded.
22
+ attr_accessor :successful_deployments
23
+
24
+ # @return [Integer] The number of deployments required by the remediation
25
+ # that have failed.
26
+ attr_accessor :failed_deployments
27
+
28
+
29
+ #
30
+ # Mapper for RemediationDeploymentSummary class as Ruby Hash.
31
+ # This will be used for serialization/deserialization.
32
+ #
33
+ def self.mapper()
34
+ {
35
+ client_side_validation: true,
36
+ required: false,
37
+ serialized_name: 'RemediationDeploymentSummary',
38
+ type: {
39
+ name: 'Composite',
40
+ class_name: 'RemediationDeploymentSummary',
41
+ model_properties: {
42
+ total_deployments: {
43
+ client_side_validation: true,
44
+ required: false,
45
+ read_only: true,
46
+ serialized_name: 'totalDeployments',
47
+ type: {
48
+ name: 'Number'
49
+ }
50
+ },
51
+ successful_deployments: {
52
+ client_side_validation: true,
53
+ required: false,
54
+ read_only: true,
55
+ serialized_name: 'successfulDeployments',
56
+ type: {
57
+ name: 'Number'
58
+ }
59
+ },
60
+ failed_deployments: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ read_only: true,
64
+ serialized_name: 'failedDeployments',
65
+ type: {
66
+ name: 'Number'
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,101 @@
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::PolicyInsights::Mgmt::V2019_07_01
7
+ module Models
8
+ #
9
+ # List of deployments for a remediation.
10
+ #
11
+ class RemediationDeploymentsListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<RemediationDeployment>] Array of deployments for the
17
+ # remediation.
18
+ attr_accessor :value
19
+
20
+ # @return [String] The URL to get the next set of results.
21
+ attr_accessor :next_link
22
+
23
+ # return [Proc] with next page method call.
24
+ attr_accessor :next_method
25
+
26
+ #
27
+ # Gets the rest of the items for the request, enabling auto-pagination.
28
+ #
29
+ # @return [Array<RemediationDeployment>] operation results.
30
+ #
31
+ def get_all_items
32
+ items = @value
33
+ page = self
34
+ while page.next_link != nil && !page.next_link.strip.empty? do
35
+ page = page.get_next_page
36
+ items.concat(page.value)
37
+ end
38
+ items
39
+ end
40
+
41
+ #
42
+ # Gets the next page of results.
43
+ #
44
+ # @return [RemediationDeploymentsListResult] with next page content.
45
+ #
46
+ def get_next_page
47
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
48
+ unless response.nil?
49
+ @next_link = response.body.next_link
50
+ @value = response.body.value
51
+ self
52
+ end
53
+ end
54
+
55
+ #
56
+ # Mapper for RemediationDeploymentsListResult class as Ruby Hash.
57
+ # This will be used for serialization/deserialization.
58
+ #
59
+ def self.mapper()
60
+ {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'RemediationDeploymentsListResult',
64
+ type: {
65
+ name: 'Composite',
66
+ class_name: 'RemediationDeploymentsListResult',
67
+ model_properties: {
68
+ value: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ read_only: true,
72
+ serialized_name: 'value',
73
+ type: {
74
+ name: 'Sequence',
75
+ element: {
76
+ client_side_validation: true,
77
+ required: false,
78
+ serialized_name: 'RemediationDeploymentElementType',
79
+ type: {
80
+ name: 'Composite',
81
+ class_name: 'RemediationDeployment'
82
+ }
83
+ }
84
+ }
85
+ },
86
+ next_link: {
87
+ client_side_validation: true,
88
+ required: false,
89
+ read_only: true,
90
+ serialized_name: 'nextLink',
91
+ type: {
92
+ name: 'String'
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ end
99
+ end
100
+ end
101
+ end
@@ -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::PolicyInsights::Mgmt::V2019_07_01
7
+ module Models
8
+ #
9
+ # The filters that will be applied to determine which resources to
10
+ # remediate.
11
+ #
12
+ class RemediationFilters
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [Array<String>] The resource locations that will be remediated.
17
+ attr_accessor :locations
18
+
19
+
20
+ #
21
+ # Mapper for RemediationFilters 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: 'RemediationFilters',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'RemediationFilters',
32
+ model_properties: {
33
+ locations: {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'locations',
37
+ type: {
38
+ name: 'Sequence',
39
+ element: {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'StringElementType',
43
+ type: {
44
+ name: 'String'
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,100 @@
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::PolicyInsights::Mgmt::V2019_07_01
7
+ module Models
8
+ #
9
+ # List of remediations.
10
+ #
11
+ class RemediationListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<Remediation>] Array of remediation definitions.
17
+ attr_accessor :value
18
+
19
+ # @return [String] The URL to get the next set of results.
20
+ attr_accessor :next_link
21
+
22
+ # return [Proc] with next page method call.
23
+ attr_accessor :next_method
24
+
25
+ #
26
+ # Gets the rest of the items for the request, enabling auto-pagination.
27
+ #
28
+ # @return [Array<Remediation>] operation results.
29
+ #
30
+ def get_all_items
31
+ items = @value
32
+ page = self
33
+ while page.next_link != nil && !page.next_link.strip.empty? do
34
+ page = page.get_next_page
35
+ items.concat(page.value)
36
+ end
37
+ items
38
+ end
39
+
40
+ #
41
+ # Gets the next page of results.
42
+ #
43
+ # @return [RemediationListResult] with next page content.
44
+ #
45
+ def get_next_page
46
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
47
+ unless response.nil?
48
+ @next_link = response.body.next_link
49
+ @value = response.body.value
50
+ self
51
+ end
52
+ end
53
+
54
+ #
55
+ # Mapper for RemediationListResult class as Ruby Hash.
56
+ # This will be used for serialization/deserialization.
57
+ #
58
+ def self.mapper()
59
+ {
60
+ client_side_validation: true,
61
+ required: false,
62
+ serialized_name: 'RemediationListResult',
63
+ type: {
64
+ name: 'Composite',
65
+ class_name: 'RemediationListResult',
66
+ model_properties: {
67
+ value: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ read_only: true,
71
+ serialized_name: 'value',
72
+ type: {
73
+ name: 'Sequence',
74
+ element: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ serialized_name: 'RemediationElementType',
78
+ type: {
79
+ name: 'Composite',
80
+ class_name: 'Remediation'
81
+ }
82
+ }
83
+ }
84
+ },
85
+ next_link: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ read_only: true,
89
+ serialized_name: 'nextLink',
90
+ type: {
91
+ name: 'String'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,16 @@
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::PolicyInsights::Mgmt::V2019_07_01
7
+ module Models
8
+ #
9
+ # Defines values for ResourceDiscoveryMode
10
+ #
11
+ module ResourceDiscoveryMode
12
+ ExistingNonCompliant = "ExistingNonCompliant"
13
+ ReEvaluateCompliance = "ReEvaluateCompliance"
14
+ end
15
+ end
16
+ 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::PolicyInsights::Mgmt::V2019_07_01
7
+ module Models
8
+ #
9
+ # Scenario specific error details.
10
+ #
11
+ class TypedErrorInfo
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The type of included error details.
16
+ attr_accessor :type
17
+
18
+ # @return The scenario specific error details.
19
+ attr_accessor :info
20
+
21
+
22
+ #
23
+ # Mapper for TypedErrorInfo 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: 'TypedErrorInfo',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'TypedErrorInfo',
34
+ model_properties: {
35
+ type: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ read_only: true,
39
+ serialized_name: 'type',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ info: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'info',
49
+ type: {
50
+ name: 'Object'
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ end
57
+ end
58
+ end
59
+ 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::PolicyInsights end
8
+ module Azure::PolicyInsights::Mgmt end
9
+ module Azure::PolicyInsights::Mgmt::V2019_07_01 end
@@ -0,0 +1,131 @@
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::PolicyInsights::Mgmt::V2019_07_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class PolicyInsightsClient < 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] Microsoft Azure subscription ID.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] Client Api Version.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [Remediations] remediations
39
+ attr_reader :remediations
40
+
41
+ #
42
+ # Creates initializes a new instance of the PolicyInsightsClient class.
43
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
44
+ # @param base_url [String] the base URI of the service.
45
+ # @param options [Array] filters to be applied to the HTTP requests.
46
+ #
47
+ def initialize(credentials = nil, base_url = nil, options = nil)
48
+ super(credentials, options)
49
+ @base_url = base_url || 'https://management.azure.com'
50
+
51
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
52
+ @credentials = credentials
53
+
54
+ @remediations = Remediations.new(self)
55
+ @api_version = '2019-07-01'
56
+ @accept_language = 'en-US'
57
+ @long_running_operation_retry_timeout = 30
58
+ @generate_client_request_id = true
59
+ add_telemetry
60
+ end
61
+
62
+ #
63
+ # Makes a request and returns the body of the response.
64
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
65
+ # @param path [String] the path, relative to {base_url}.
66
+ # @param options [Hash{String=>String}] specifying any request options like :body.
67
+ # @return [Hash{String=>String}] containing the body of the response.
68
+ # Example:
69
+ #
70
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
71
+ # path = "/path"
72
+ # options = {
73
+ # body: request_content,
74
+ # query_params: {'api-version' => '2016-02-01'}
75
+ # }
76
+ # result = @client.make_request(:put, path, options)
77
+ #
78
+ def make_request(method, path, options = {})
79
+ result = make_request_with_http_info(method, path, options)
80
+ result.body unless result.nil?
81
+ end
82
+
83
+ #
84
+ # Makes a request and returns the operation response.
85
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
86
+ # @param path [String] the path, relative to {base_url}.
87
+ # @param options [Hash{String=>String}] specifying any request options like :body.
88
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
89
+ #
90
+ def make_request_with_http_info(method, path, options = {})
91
+ result = make_request_async(method, path, options).value!
92
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
93
+ result
94
+ end
95
+
96
+ #
97
+ # Makes a request asynchronously.
98
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
99
+ # @param path [String] the path, relative to {base_url}.
100
+ # @param options [Hash{String=>String}] specifying any request options like :body.
101
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
102
+ #
103
+ def make_request_async(method, path, options = {})
104
+ fail ArgumentError, 'method is nil' if method.nil?
105
+ fail ArgumentError, 'path is nil' if path.nil?
106
+
107
+ request_url = options[:base_url] || @base_url
108
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
109
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
110
+ end
111
+
112
+ request_headers = @request_headers
113
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
114
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
115
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
116
+
117
+ super(request_url, method, path, options)
118
+ end
119
+
120
+
121
+ private
122
+ #
123
+ # Adds telemetry information.
124
+ #
125
+ def add_telemetry
126
+ sdk_information = 'azure_mgmt_policy_insights'
127
+ sdk_information = "#{sdk_information}/0.17.8"
128
+ add_user_agent_information(sdk_information)
129
+ end
130
+ end
131
+ end