azure_mgmt_policy_insights 0.17.2 → 0.17.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-09-preview/generated/azure_mgmt_policy_insights/operations.rb +2 -0
  3. data/lib/2017-08-09-preview/generated/azure_mgmt_policy_insights/policy_events.rb +8 -0
  4. data/lib/2017-08-09-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  5. data/lib/2017-08-09-preview/generated/azure_mgmt_policy_insights/policy_states.rb +8 -0
  6. data/lib/2017-10-17-preview/generated/azure_mgmt_policy_insights/operations.rb +2 -0
  7. data/lib/2017-10-17-preview/generated/azure_mgmt_policy_insights/policy_events.rb +10 -0
  8. data/lib/2017-10-17-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  9. data/lib/2017-10-17-preview/generated/azure_mgmt_policy_insights/policy_states.rb +10 -0
  10. data/lib/2017-12-12-preview/generated/azure_mgmt_policy_insights/operations.rb +2 -0
  11. data/lib/2017-12-12-preview/generated/azure_mgmt_policy_insights/policy_events.rb +18 -0
  12. data/lib/2017-12-12-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  13. data/lib/2017-12-12-preview/generated/azure_mgmt_policy_insights/policy_states.rb +34 -0
  14. data/lib/2018-04-04/generated/azure_mgmt_policy_insights/operations.rb +2 -0
  15. data/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_events.rb +18 -0
  16. data/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  17. data/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_states.rb +34 -0
  18. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights.rb +27 -11
  19. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/expression_evaluation_details.rb +103 -0
  20. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/if_not_exists_evaluation_details.rb +59 -0
  21. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/operation.rb +59 -0
  22. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/operation_display.rb +79 -0
  23. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/operations_list_results.rb +70 -0
  24. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/policy_assignment_summary.rb +91 -0
  25. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/policy_definition_summary.rb +81 -0
  26. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/policy_evaluation_details.rb +69 -0
  27. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/policy_state.rb +384 -0
  28. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/policy_states_query_results.rb +82 -0
  29. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/policy_states_resource.rb +16 -0
  30. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/query_options.rb +69 -0
  31. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/summarize_results.rb +83 -0
  32. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/summary.rb +92 -0
  33. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/summary_results.rb +76 -0
  34. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/operations.rb +109 -0
  35. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +9 -1
  36. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/policy_states.rb +2127 -0
  37. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/policy_tracked_resources.rb +16 -0
  38. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb +64 -0
  39. data/lib/2019-10-01/generated/azure_mgmt_policy_insights.rb +55 -0
  40. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/compliance_detail.rb +57 -0
  41. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/error_definition.rb +115 -0
  42. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/error_response.rb +47 -0
  43. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/expression_evaluation_details.rb +103 -0
  44. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/if_not_exists_evaluation_details.rb +59 -0
  45. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/operation.rb +59 -0
  46. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/operation_display.rb +79 -0
  47. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/operations_list_results.rb +70 -0
  48. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_assignment_summary.rb +110 -0
  49. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_definition_summary.rb +99 -0
  50. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_evaluation_details.rb +69 -0
  51. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_group_summary.rb +59 -0
  52. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_metadata.rb +168 -0
  53. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_metadata_collection.rb +101 -0
  54. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_state.rb +440 -0
  55. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_states_query_results.rb +82 -0
  56. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_states_resource.rb +16 -0
  57. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/query_failure.rb +47 -0
  58. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/query_failure_error.rb +60 -0
  59. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/query_options.rb +123 -0
  60. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/slim_policy_metadata.rb +145 -0
  61. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/summarize_results.rb +83 -0
  62. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/summary.rb +91 -0
  63. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/summary_results.rb +140 -0
  64. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/typed_error_info.rb +59 -0
  65. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/module_definition.rb +9 -0
  66. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/operations.rb +109 -0
  67. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_insights_client.rb +136 -0
  68. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_metadata_operations.rb +316 -0
  69. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_states.rb +2267 -0
  70. data/lib/azure_mgmt_policy_insights.rb +3 -2
  71. data/lib/profiles/latest/modules/policyinsights_profile_module.rb +125 -83
  72. data/lib/version.rb +1 -1
  73. metadata +52 -5
@@ -0,0 +1,83 @@
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_10_01
7
+ module Models
8
+ #
9
+ # Summarize action results.
10
+ #
11
+ class SummarizeResults
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] OData context string; used by OData clients to resolve
16
+ # type information based on metadata.
17
+ attr_accessor :odatacontext
18
+
19
+ # @return [Integer] OData entity count; represents the number of
20
+ # summaries returned; always set to 1.
21
+ attr_accessor :odatacount
22
+
23
+ # @return [Array<Summary>] Summarize action results.
24
+ attr_accessor :value
25
+
26
+
27
+ #
28
+ # Mapper for SummarizeResults class as Ruby Hash.
29
+ # This will be used for serialization/deserialization.
30
+ #
31
+ def self.mapper()
32
+ {
33
+ client_side_validation: true,
34
+ required: false,
35
+ serialized_name: 'SummarizeResults',
36
+ type: {
37
+ name: 'Composite',
38
+ class_name: 'SummarizeResults',
39
+ model_properties: {
40
+ odatacontext: {
41
+ client_side_validation: true,
42
+ required: false,
43
+ serialized_name: '@odata\\.context',
44
+ type: {
45
+ name: 'String'
46
+ }
47
+ },
48
+ odatacount: {
49
+ client_side_validation: true,
50
+ required: false,
51
+ serialized_name: '@odata\\.count',
52
+ constraints: {
53
+ InclusiveMaximum: 1,
54
+ InclusiveMinimum: 1
55
+ },
56
+ type: {
57
+ name: 'Number'
58
+ }
59
+ },
60
+ value: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'value',
64
+ type: {
65
+ name: 'Sequence',
66
+ element: {
67
+ client_side_validation: true,
68
+ required: false,
69
+ serialized_name: 'SummaryElementType',
70
+ type: {
71
+ name: 'Composite',
72
+ class_name: 'Summary'
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,91 @@
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_10_01
7
+ module Models
8
+ #
9
+ # Summary results.
10
+ #
11
+ class Summary
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] OData entity ID; always set to null since summaries do
16
+ # not have an entity ID.
17
+ attr_accessor :odataid
18
+
19
+ # @return [String] OData context string; used by OData clients to resolve
20
+ # type information based on metadata.
21
+ attr_accessor :odatacontext
22
+
23
+ # @return [SummaryResults] Compliance summary for all policy assignments.
24
+ attr_accessor :results
25
+
26
+ # @return [Array<PolicyAssignmentSummary>] Policy assignments summary.
27
+ attr_accessor :policy_assignments
28
+
29
+
30
+ #
31
+ # Mapper for Summary class as Ruby Hash.
32
+ # This will be used for serialization/deserialization.
33
+ #
34
+ def self.mapper()
35
+ {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'Summary',
39
+ type: {
40
+ name: 'Composite',
41
+ class_name: 'Summary',
42
+ model_properties: {
43
+ odataid: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: '@odata\\.id',
47
+ type: {
48
+ name: 'String'
49
+ }
50
+ },
51
+ odatacontext: {
52
+ client_side_validation: true,
53
+ required: false,
54
+ serialized_name: '@odata\\.context',
55
+ type: {
56
+ name: 'String'
57
+ }
58
+ },
59
+ results: {
60
+ client_side_validation: true,
61
+ required: false,
62
+ serialized_name: 'results',
63
+ type: {
64
+ name: 'Composite',
65
+ class_name: 'SummaryResults'
66
+ }
67
+ },
68
+ policy_assignments: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'policyAssignments',
72
+ type: {
73
+ name: 'Sequence',
74
+ element: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ serialized_name: 'PolicyAssignmentSummaryElementType',
78
+ type: {
79
+ name: 'Composite',
80
+ class_name: 'PolicyAssignmentSummary'
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,140 @@
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_10_01
7
+ module Models
8
+ #
9
+ # Compliance summary on a particular summary level.
10
+ #
11
+ class SummaryResults
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] HTTP POST URI for queryResults action on
16
+ # Microsoft.PolicyInsights to retrieve raw results for the compliance
17
+ # summary. This property will not be available by default in future API
18
+ # versions, but could be queried explicitly.
19
+ attr_accessor :query_results_uri
20
+
21
+ # @return [Integer] Number of non-compliant resources.
22
+ attr_accessor :non_compliant_resources
23
+
24
+ # @return [Integer] Number of non-compliant policies.
25
+ attr_accessor :non_compliant_policies
26
+
27
+ # @return [Array<ComplianceDetail>] The resources summary at this level.
28
+ attr_accessor :resource_details
29
+
30
+ # @return [Array<ComplianceDetail>] The policy artifact summary at this
31
+ # level. For query scope level, it represents policy assignment summary.
32
+ # For policy assignment level, it represents policy definitions summary.
33
+ attr_accessor :policy_details
34
+
35
+ # @return [Array<ComplianceDetail>] The policy definition group summary
36
+ # at this level.
37
+ attr_accessor :policy_group_details
38
+
39
+
40
+ #
41
+ # Mapper for SummaryResults 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: 'SummaryResults',
49
+ type: {
50
+ name: 'Composite',
51
+ class_name: 'SummaryResults',
52
+ model_properties: {
53
+ query_results_uri: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ serialized_name: 'queryResultsUri',
57
+ type: {
58
+ name: 'String'
59
+ }
60
+ },
61
+ non_compliant_resources: {
62
+ client_side_validation: true,
63
+ required: false,
64
+ serialized_name: 'nonCompliantResources',
65
+ constraints: {
66
+ InclusiveMinimum: 0
67
+ },
68
+ type: {
69
+ name: 'Number'
70
+ }
71
+ },
72
+ non_compliant_policies: {
73
+ client_side_validation: true,
74
+ required: false,
75
+ serialized_name: 'nonCompliantPolicies',
76
+ constraints: {
77
+ InclusiveMinimum: 0
78
+ },
79
+ type: {
80
+ name: 'Number'
81
+ }
82
+ },
83
+ resource_details: {
84
+ client_side_validation: true,
85
+ required: false,
86
+ serialized_name: 'resourceDetails',
87
+ type: {
88
+ name: 'Sequence',
89
+ element: {
90
+ client_side_validation: true,
91
+ required: false,
92
+ serialized_name: 'ComplianceDetailElementType',
93
+ type: {
94
+ name: 'Composite',
95
+ class_name: 'ComplianceDetail'
96
+ }
97
+ }
98
+ }
99
+ },
100
+ policy_details: {
101
+ client_side_validation: true,
102
+ required: false,
103
+ serialized_name: 'policyDetails',
104
+ type: {
105
+ name: 'Sequence',
106
+ element: {
107
+ client_side_validation: true,
108
+ required: false,
109
+ serialized_name: 'ComplianceDetailElementType',
110
+ type: {
111
+ name: 'Composite',
112
+ class_name: 'ComplianceDetail'
113
+ }
114
+ }
115
+ }
116
+ },
117
+ policy_group_details: {
118
+ client_side_validation: true,
119
+ required: false,
120
+ serialized_name: 'policyGroupDetails',
121
+ type: {
122
+ name: 'Sequence',
123
+ element: {
124
+ client_side_validation: true,
125
+ required: false,
126
+ serialized_name: 'ComplianceDetailElementType',
127
+ type: {
128
+ name: 'Composite',
129
+ class_name: 'ComplianceDetail'
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+ end
138
+ end
139
+ end
140
+ 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_10_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_10_01 end
@@ -0,0 +1,109 @@
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_10_01
7
+ #
8
+ # Operations
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 [PolicyInsightsClient] reference to the PolicyInsightsClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists available operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [OperationsListResults] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ response = list_async(custom_headers:custom_headers).value!
34
+ response.body unless response.nil?
35
+ end
36
+
37
+ #
38
+ # Lists available operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists available operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
63
+
64
+ # Set Headers
65
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
66
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
67
+ path_template = 'providers/Microsoft.PolicyInsights/operations'
68
+
69
+ request_url = @base_url || @client.base_url
70
+
71
+ options = {
72
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
73
+ query_params: {'api-version' => @client.api_version},
74
+ headers: request_headers.merge(custom_headers || {}),
75
+ base_url: request_url
76
+ }
77
+ promise = @client.make_request_async(:get, path_template, options)
78
+
79
+ promise = promise.then do |result|
80
+ http_response = result.response
81
+ status_code = http_response.status
82
+ response_content = http_response.body
83
+ unless status_code == 200
84
+ error_model = JSON.load(response_content)
85
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
86
+ end
87
+
88
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
90
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
91
+ # Deserialize Response
92
+ if status_code == 200
93
+ begin
94
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
95
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::OperationsListResults.mapper()
96
+ result.body = @client.deserialize(result_mapper, parsed_response)
97
+ rescue Exception => e
98
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
99
+ end
100
+ end
101
+
102
+ result
103
+ end
104
+
105
+ promise.execute
106
+ end
107
+
108
+ end
109
+ end