Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Automatic PR from RestAPI-PR1641 #979

Merged
merged 1 commit into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 32 additions & 23 deletions management/azure_mgmt_monitor/lib/generated/azure_mgmt_monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,62 @@

module Azure::ARM::Monitor
autoload :AutoscaleSettings, 'generated/azure_mgmt_monitor/autoscale_settings.rb'
autoload :Operations, 'generated/azure_mgmt_monitor/operations.rb'
autoload :AlertRuleIncidents, 'generated/azure_mgmt_monitor/alert_rule_incidents.rb'
autoload :AlertRules, 'generated/azure_mgmt_monitor/alert_rules.rb'
autoload :LogProfiles, 'generated/azure_mgmt_monitor/log_profiles.rb'
autoload :ServiceDiagnosticSettingsOperations, 'generated/azure_mgmt_monitor/service_diagnostic_settings_operations.rb'
autoload :DiagnosticSettingsOperations, 'generated/azure_mgmt_monitor/diagnostic_settings_operations.rb'
autoload :DiagnosticSettingsCategoryOperations, 'generated/azure_mgmt_monitor/diagnostic_settings_category_operations.rb'
autoload :ActionGroups, 'generated/azure_mgmt_monitor/action_groups.rb'
autoload :ActivityLogAlerts, 'generated/azure_mgmt_monitor/activity_log_alerts.rb'
autoload :MonitorManagementClient, 'generated/azure_mgmt_monitor/monitor_management_client.rb'

module Models
autoload :RuleAction, 'generated/azure_mgmt_monitor/models/rule_action.rb'
autoload :ActionGroupList, 'generated/azure_mgmt_monitor/models/action_group_list.rb'
autoload :WebhookReceiver, 'generated/azure_mgmt_monitor/models/webhook_receiver.rb'
autoload :MetricTrigger, 'generated/azure_mgmt_monitor/models/metric_trigger.rb'
autoload :ActivityLogAlertLeafCondition, 'generated/azure_mgmt_monitor/models/activity_log_alert_leaf_condition.rb'
autoload :ScaleRule, 'generated/azure_mgmt_monitor/models/scale_rule.rb'
autoload :ManagementEventAggregationCondition, 'generated/azure_mgmt_monitor/models/management_event_aggregation_condition.rb'
autoload :RecurrentSchedule, 'generated/azure_mgmt_monitor/models/recurrent_schedule.rb'
autoload :EnableRequest, 'generated/azure_mgmt_monitor/models/enable_request.rb'
autoload :RecurrentSchedule, 'generated/azure_mgmt_monitor/models/recurrent_schedule.rb'
autoload :ManagementEventAggregationCondition, 'generated/azure_mgmt_monitor/models/management_event_aggregation_condition.rb'
autoload :AutoscaleProfile, 'generated/azure_mgmt_monitor/models/autoscale_profile.rb'
autoload :ScaleCapacity, 'generated/azure_mgmt_monitor/models/scale_capacity.rb'
autoload :ActionGroupList, 'generated/azure_mgmt_monitor/models/action_group_list.rb'
autoload :WebhookNotification, 'generated/azure_mgmt_monitor/models/webhook_notification.rb'
autoload :ScaleCapacity, 'generated/azure_mgmt_monitor/models/scale_capacity.rb'
autoload :AutoscaleNotification, 'generated/azure_mgmt_monitor/models/autoscale_notification.rb'
autoload :AutoscaleSettingResourcePatch, 'generated/azure_mgmt_monitor/models/autoscale_setting_resource_patch.rb'
autoload :SmsReceiver, 'generated/azure_mgmt_monitor/models/sms_receiver.rb'
autoload :ErrorResponse, 'generated/azure_mgmt_monitor/models/error_response.rb'
autoload :EmailReceiver, 'generated/azure_mgmt_monitor/models/email_receiver.rb'
autoload :AutoscaleSettingResourceCollection, 'generated/azure_mgmt_monitor/models/autoscale_setting_resource_collection.rb'
autoload :OperationDisplay, 'generated/azure_mgmt_monitor/models/operation_display.rb'
autoload :ActivityLogAlertPatchBody, 'generated/azure_mgmt_monitor/models/activity_log_alert_patch_body.rb'
autoload :IncidentListResult, 'generated/azure_mgmt_monitor/models/incident_list_result.rb'
autoload :OperationListResult, 'generated/azure_mgmt_monitor/models/operation_list_result.rb'
autoload :ActivityLogAlertList, 'generated/azure_mgmt_monitor/models/activity_log_alert_list.rb'
autoload :RuleCondition, 'generated/azure_mgmt_monitor/models/rule_condition.rb'
autoload :IncidentListResult, 'generated/azure_mgmt_monitor/models/incident_list_result.rb'
autoload :AlertRuleResourcePatch, 'generated/azure_mgmt_monitor/models/alert_rule_resource_patch.rb'
autoload :RuleManagementEventClaimsDataSource, 'generated/azure_mgmt_monitor/models/rule_management_event_claims_data_source.rb'
autoload :RuleCondition, 'generated/azure_mgmt_monitor/models/rule_condition.rb'
autoload :AlertRuleResourceCollection, 'generated/azure_mgmt_monitor/models/alert_rule_resource_collection.rb'
autoload :ScaleAction, 'generated/azure_mgmt_monitor/models/scale_action.rb'
autoload :RuleManagementEventClaimsDataSource, 'generated/azure_mgmt_monitor/models/rule_management_event_claims_data_source.rb'
autoload :RetentionPolicy, 'generated/azure_mgmt_monitor/models/retention_policy.rb'
autoload :Recurrence, 'generated/azure_mgmt_monitor/models/recurrence.rb'
autoload :TimeWindow, 'generated/azure_mgmt_monitor/models/time_window.rb'
autoload :ActivityLogAlertActionList, 'generated/azure_mgmt_monitor/models/activity_log_alert_action_list.rb'
autoload :AutoscaleSettingResourceCollection, 'generated/azure_mgmt_monitor/models/autoscale_setting_resource_collection.rb'
autoload :EmailNotification, 'generated/azure_mgmt_monitor/models/email_notification.rb'
autoload :LogProfileResourcePatch, 'generated/azure_mgmt_monitor/models/log_profile_resource_patch.rb'
autoload :RuleDataSource, 'generated/azure_mgmt_monitor/models/rule_data_source.rb'
autoload :ErrorResponse, 'generated/azure_mgmt_monitor/models/error_response.rb'
autoload :LogProfileCollection, 'generated/azure_mgmt_monitor/models/log_profile_collection.rb'
autoload :WebhookReceiver, 'generated/azure_mgmt_monitor/models/webhook_receiver.rb'
autoload :Incident, 'generated/azure_mgmt_monitor/models/incident.rb'
autoload :ProxyOnlyResource, 'generated/azure_mgmt_monitor/models/proxy_only_resource.rb'
autoload :SmsReceiver, 'generated/azure_mgmt_monitor/models/sms_receiver.rb'
autoload :MetricSettings, 'generated/azure_mgmt_monitor/models/metric_settings.rb'
autoload :EmailNotification, 'generated/azure_mgmt_monitor/models/email_notification.rb'
autoload :Recurrence, 'generated/azure_mgmt_monitor/models/recurrence.rb'
autoload :LogSettings, 'generated/azure_mgmt_monitor/models/log_settings.rb'
autoload :ActivityLogAlertAllOfCondition, 'generated/azure_mgmt_monitor/models/activity_log_alert_all_of_condition.rb'
autoload :Operation, 'generated/azure_mgmt_monitor/models/operation.rb'
autoload :ActivityLogAlertActionGroup, 'generated/azure_mgmt_monitor/models/activity_log_alert_action_group.rb'
autoload :Incident, 'generated/azure_mgmt_monitor/models/incident.rb'
autoload :ServiceDiagnosticSettingsResourcePatch, 'generated/azure_mgmt_monitor/models/service_diagnostic_settings_resource_patch.rb'
autoload :TimeWindow, 'generated/azure_mgmt_monitor/models/time_window.rb'
autoload :EmailReceiver, 'generated/azure_mgmt_monitor/models/email_receiver.rb'
autoload :ScaleAction, 'generated/azure_mgmt_monitor/models/scale_action.rb'
autoload :DiagnosticSettingsResourceCollection, 'generated/azure_mgmt_monitor/models/diagnostic_settings_resource_collection.rb'
autoload :RuleDataSource, 'generated/azure_mgmt_monitor/models/rule_data_source.rb'
autoload :ActivityLogAlertAllOfCondition, 'generated/azure_mgmt_monitor/models/activity_log_alert_all_of_condition.rb'
autoload :AutoscaleSettingResourcePatch, 'generated/azure_mgmt_monitor/models/autoscale_setting_resource_patch.rb'
autoload :DiagnosticSettingsCategoryResourceCollection, 'generated/azure_mgmt_monitor/models/diagnostic_settings_category_resource_collection.rb'
autoload :AutoscaleSettingResource, 'generated/azure_mgmt_monitor/models/autoscale_setting_resource.rb'
autoload :RuleMetricDataSource, 'generated/azure_mgmt_monitor/models/rule_metric_data_source.rb'
autoload :RuleManagementEventDataSource, 'generated/azure_mgmt_monitor/models/rule_management_event_data_source.rb'
Expand All @@ -80,7 +87,8 @@ module Models
autoload :RuleWebhookAction, 'generated/azure_mgmt_monitor/models/rule_webhook_action.rb'
autoload :AlertRuleResource, 'generated/azure_mgmt_monitor/models/alert_rule_resource.rb'
autoload :LogProfileResource, 'generated/azure_mgmt_monitor/models/log_profile_resource.rb'
autoload :ServiceDiagnosticSettingsResource, 'generated/azure_mgmt_monitor/models/service_diagnostic_settings_resource.rb'
autoload :DiagnosticSettingsResource, 'generated/azure_mgmt_monitor/models/diagnostic_settings_resource.rb'
autoload :DiagnosticSettingsCategoryResource, 'generated/azure_mgmt_monitor/models/diagnostic_settings_category_resource.rb'
autoload :ActionGroupResource, 'generated/azure_mgmt_monitor/models/action_group_resource.rb'
autoload :ActivityLogAlertResource, 'generated/azure_mgmt_monitor/models/activity_log_alert_resource.rb'
autoload :MetricStatisticType, 'generated/azure_mgmt_monitor/models/metric_statistic_type.rb'
Expand All @@ -91,6 +99,7 @@ module Models
autoload :RecurrenceFrequency, 'generated/azure_mgmt_monitor/models/recurrence_frequency.rb'
autoload :ConditionOperator, 'generated/azure_mgmt_monitor/models/condition_operator.rb'
autoload :TimeAggregationOperator, 'generated/azure_mgmt_monitor/models/time_aggregation_operator.rb'
autoload :CategoryType, 'generated/azure_mgmt_monitor/models/category_type.rb'
autoload :ReceiverStatus, 'generated/azure_mgmt_monitor/models/receiver_status.rb'
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::ARM::Monitor
#
# Monitor Management Client
#
class DiagnosticSettingsCategoryOperations
include MsRestAzure

#
# Creates and initializes a new instance of the DiagnosticSettingsCategoryOperations class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end

# @return [MonitorManagementClient] reference to the MonitorManagementClient
attr_reader :client

#
# Gets the diagnostic settings category for the specified resource.
#
# @param resource_uri [String] The identifier of the resource.
# @param name [String] The name of the diagnostic setting.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [DiagnosticSettingsCategoryResource] operation results.
#
def get(resource_uri, name, custom_headers = nil)
response = get_async(resource_uri, name, custom_headers).value!
response.body unless response.nil?
end

#
# Gets the diagnostic settings category for the specified resource.
#
# @param resource_uri [String] The identifier of the resource.
# @param name [String] The name of the diagnostic setting.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def get_with_http_info(resource_uri, name, custom_headers = nil)
get_async(resource_uri, name, custom_headers).value!
end

#
# Gets the diagnostic settings category for the specified resource.
#
# @param resource_uri [String] The identifier of the resource.
# @param name [String] The name of the diagnostic setting.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def get_async(resource_uri, name, custom_headers = nil)
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
api_version = '2017-05-01-preview'
fail ArgumentError, 'name is nil' if name.nil?


request_headers = {}

# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories/{name}'

request_url = @base_url || @client.base_url

options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceUri' => resource_uri,'name' => name},
query_params: {'api-version' => api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)

promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end

result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::Monitor::Models::DiagnosticSettingsCategoryResource.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end

result
end

promise.execute
end

#
# Lists the diagnostic settings categories for the specified resource.
#
# @param resource_uri [String] The identifier of the resource.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [DiagnosticSettingsCategoryResourceCollection] operation results.
#
def list(resource_uri, custom_headers = nil)
response = list_async(resource_uri, custom_headers).value!
response.body unless response.nil?
end

#
# Lists the diagnostic settings categories for the specified resource.
#
# @param resource_uri [String] The identifier of the resource.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_with_http_info(resource_uri, custom_headers = nil)
list_async(resource_uri, custom_headers).value!
end

#
# Lists the diagnostic settings categories for the specified resource.
#
# @param resource_uri [String] The identifier of the resource.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_async(resource_uri, custom_headers = nil)
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
api_version = '2017-05-01-preview'


request_headers = {}

# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories'

request_url = @base_url || @client.base_url

options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceUri' => resource_uri},
query_params: {'api-version' => api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)

promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end

result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::Monitor::Models::DiagnosticSettingsCategoryResourceCollection.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end

result
end

promise.execute
end

end
end
Loading