diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics.rb index ff3fb2f380..a8b5906f37 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics.rb @@ -20,31 +20,36 @@ require 'ms_rest_azure' module Azure::ARM::DataLakeAnalytics + autoload :FirewallRules, 'generated/azure_mgmt_datalake_analytics/firewall_rules.rb' autoload :StorageAccounts, 'generated/azure_mgmt_datalake_analytics/storage_accounts.rb' autoload :DataLakeStoreAccounts, 'generated/azure_mgmt_datalake_analytics/data_lake_store_accounts.rb' autoload :Account, 'generated/azure_mgmt_datalake_analytics/account.rb' autoload :DataLakeAnalyticsAccountManagementClient, 'generated/azure_mgmt_datalake_analytics/data_lake_analytics_account_management_client.rb' module Models - autoload :AddDataLakeStoreParameters, 'generated/azure_mgmt_datalake_analytics/models/add_data_lake_store_parameters.rb' autoload :AddStorageAccountParameters, 'generated/azure_mgmt_datalake_analytics/models/add_storage_account_parameters.rb' - autoload :CreateStorageAccountInfo, 'generated/azure_mgmt_datalake_analytics/models/create_storage_account_info.rb' - autoload :UpdateStorageAccountParameters, 'generated/azure_mgmt_datalake_analytics/models/update_storage_account_parameters.rb' + autoload :SubResource, 'generated/azure_mgmt_datalake_analytics/models/sub_resource.rb' + autoload :AddDataLakeStoreParameters, 'generated/azure_mgmt_datalake_analytics/models/add_data_lake_store_parameters.rb' autoload :ListStorageContainersResult, 'generated/azure_mgmt_datalake_analytics/models/list_storage_containers_result.rb' - autoload :DataLakeAnalyticsAccountUpdateParameters, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_update_parameters.rb' + autoload :OptionalSubResource, 'generated/azure_mgmt_datalake_analytics/models/optional_sub_resource.rb' autoload :ListSasTokensResult, 'generated/azure_mgmt_datalake_analytics/models/list_sas_tokens_result.rb' - autoload :DataLakeStoreAccountInfo, 'generated/azure_mgmt_datalake_analytics/models/data_lake_store_account_info.rb' - autoload :DataLakeAnalyticsAccountListDataLakeStoreResult, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_list_data_lake_store_result.rb' - autoload :DataLakeAnalyticsAccountListResult, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_list_result.rb' - autoload :StorageContainer, 'generated/azure_mgmt_datalake_analytics/models/storage_container.rb' - autoload :ErrorDetails, 'generated/azure_mgmt_datalake_analytics/models/error_details.rb' + autoload :UpdateStorageAccountParameters, 'generated/azure_mgmt_datalake_analytics/models/update_storage_account_parameters.rb' autoload :DataLakeAnalyticsAccountListStorageAccountsResult, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_list_storage_accounts_result.rb' - autoload :InnerError, 'generated/azure_mgmt_datalake_analytics/models/inner_error.rb' + autoload :DataLakeAnalyticsAccountUpdateParameters, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_update_parameters.rb' + autoload :StorageContainer, 'generated/azure_mgmt_datalake_analytics/models/storage_container.rb' + autoload :DataLakeAnalyticsAccountListResult, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_list_result.rb' autoload :SasTokenInfo, 'generated/azure_mgmt_datalake_analytics/models/sas_token_info.rb' - autoload :Error, 'generated/azure_mgmt_datalake_analytics/models/error.rb' + autoload :DataLakeAnalyticsFirewallRuleListResult, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_firewall_rule_list_result.rb' + autoload :DataLakeAnalyticsAccountListDataLakeStoreResult, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_list_data_lake_store_result.rb' + autoload :UpdateFirewallRuleParameters, 'generated/azure_mgmt_datalake_analytics/models/update_firewall_rule_parameters.rb' autoload :StorageAccountInfo, 'generated/azure_mgmt_datalake_analytics/models/storage_account_info.rb' + autoload :DataLakeStoreAccountInfo, 'generated/azure_mgmt_datalake_analytics/models/data_lake_store_account_info.rb' + autoload :FirewallRule, 'generated/azure_mgmt_datalake_analytics/models/firewall_rule.rb' autoload :DataLakeAnalyticsAccount, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account.rb' autoload :DataLakeAnalyticsAccountStatus, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_status.rb' autoload :DataLakeAnalyticsAccountState, 'generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_state.rb' + autoload :TierType, 'generated/azure_mgmt_datalake_analytics/models/tier_type.rb' + autoload :FirewallState, 'generated/azure_mgmt_datalake_analytics/models/firewall_state.rb' + autoload :FirewallAllowAzureIpsState, 'generated/azure_mgmt_datalake_analytics/models/firewall_allow_azure_ips_state.rb' end end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/account.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/account.rb index fbb4935fd5..163e4a0e8a 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/account.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/account.rb @@ -431,7 +431,8 @@ def delete_async(resource_group_name, account_name, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account.the account will be associated with. - # @param name [String] The name of the Data Lake Analytics account to create. + # @param account_name [String] The name of the Data Lake Analytics account to + # create. # @param parameters [DataLakeAnalyticsAccount] Parameters supplied to the # create Data Lake Analytics account operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -439,15 +440,16 @@ def delete_async(resource_group_name, account_name, custom_headers = nil) # # @return [DataLakeAnalyticsAccount] operation results. # - def create(resource_group_name, name, parameters, custom_headers = nil) - response = create_async(resource_group_name, name, parameters, custom_headers).value! + def create(resource_group_name, account_name, parameters, custom_headers = nil) + response = create_async(resource_group_name, account_name, parameters, custom_headers).value! response.body unless response.nil? end # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account.the account will be associated with. - # @param name [String] The name of the Data Lake Analytics account to create. + # @param account_name [String] The name of the Data Lake Analytics account to + # create. # @param parameters [DataLakeAnalyticsAccount] Parameters supplied to the # create Data Lake Analytics account operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -456,9 +458,9 @@ def create(resource_group_name, name, parameters, custom_headers = nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def create_async(resource_group_name, name, parameters, custom_headers = nil) + def create_async(resource_group_name, account_name, parameters, custom_headers = nil) # Send request - promise = begin_create_async(resource_group_name, name, parameters, custom_headers) + promise = begin_create_async(resource_group_name, account_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -480,7 +482,8 @@ def create_async(resource_group_name, name, parameters, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account. - # @param name [String] The name of the Data Lake Analytics account to update. + # @param account_name [String] The name of the Data Lake Analytics account to + # update. # @param parameters [DataLakeAnalyticsAccountUpdateParameters] Parameters # supplied to the update Data Lake Analytics account operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -488,15 +491,16 @@ def create_async(resource_group_name, name, parameters, custom_headers = nil) # # @return [DataLakeAnalyticsAccount] operation results. # - def update(resource_group_name, name, parameters = nil, custom_headers = nil) - response = update_async(resource_group_name, name, parameters, custom_headers).value! + def update(resource_group_name, account_name, parameters = nil, custom_headers = nil) + response = update_async(resource_group_name, account_name, parameters, custom_headers).value! response.body unless response.nil? end # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account. - # @param name [String] The name of the Data Lake Analytics account to update. + # @param account_name [String] The name of the Data Lake Analytics account to + # update. # @param parameters [DataLakeAnalyticsAccountUpdateParameters] Parameters # supplied to the update Data Lake Analytics account operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -505,9 +509,9 @@ def update(resource_group_name, name, parameters = nil, custom_headers = nil) # @return [Concurrent::Promise] promise which provides async access to http # response. # - def update_async(resource_group_name, name, parameters = nil, custom_headers = nil) + def update_async(resource_group_name, account_name, parameters = nil, custom_headers = nil) # Send request - promise = begin_update_async(resource_group_name, name, parameters, custom_headers) + promise = begin_update_async(resource_group_name, account_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -618,7 +622,8 @@ def begin_delete_async(resource_group_name, account_name, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account.the account will be associated with. - # @param name [String] The name of the Data Lake Analytics account to create. + # @param account_name [String] The name of the Data Lake Analytics account to + # create. # @param parameters [DataLakeAnalyticsAccount] Parameters supplied to the # create Data Lake Analytics account operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -626,8 +631,8 @@ def begin_delete_async(resource_group_name, account_name, custom_headers = nil) # # @return [DataLakeAnalyticsAccount] operation results. # - def begin_create(resource_group_name, name, parameters, custom_headers = nil) - response = begin_create_async(resource_group_name, name, parameters, custom_headers).value! + def begin_create(resource_group_name, account_name, parameters, custom_headers = nil) + response = begin_create_async(resource_group_name, account_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -637,7 +642,8 @@ def begin_create(resource_group_name, name, parameters, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account.the account will be associated with. - # @param name [String] The name of the Data Lake Analytics account to create. + # @param account_name [String] The name of the Data Lake Analytics account to + # create. # @param parameters [DataLakeAnalyticsAccount] Parameters supplied to the # create Data Lake Analytics account operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -645,8 +651,8 @@ def begin_create(resource_group_name, name, parameters, custom_headers = nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_create_with_http_info(resource_group_name, name, parameters, custom_headers = nil) - begin_create_async(resource_group_name, name, parameters, custom_headers).value! + def begin_create_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil) + begin_create_async(resource_group_name, account_name, parameters, custom_headers).value! end # @@ -655,7 +661,8 @@ def begin_create_with_http_info(resource_group_name, name, parameters, custom_he # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account.the account will be associated with. - # @param name [String] The name of the Data Lake Analytics account to create. + # @param account_name [String] The name of the Data Lake Analytics account to + # create. # @param parameters [DataLakeAnalyticsAccount] Parameters supplied to the # create Data Lake Analytics account operation. # @param [Hash{String => String}] A hash of custom headers that will be added @@ -663,9 +670,9 @@ def begin_create_with_http_info(resource_group_name, name, parameters, custom_he # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_create_async(resource_group_name, name, parameters, custom_headers = nil) + def begin_create_async(resource_group_name, account_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? @@ -684,13 +691,13 @@ def begin_create_async(resource_group_name, name, parameters, custom_headers = n request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}' + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id}, + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), @@ -741,7 +748,8 @@ def begin_create_async(resource_group_name, name, parameters, custom_headers = n # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account. - # @param name [String] The name of the Data Lake Analytics account to update. + # @param account_name [String] The name of the Data Lake Analytics account to + # update. # @param parameters [DataLakeAnalyticsAccountUpdateParameters] Parameters # supplied to the update Data Lake Analytics account operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -749,8 +757,8 @@ def begin_create_async(resource_group_name, name, parameters, custom_headers = n # # @return [DataLakeAnalyticsAccount] operation results. # - def begin_update(resource_group_name, name, parameters = nil, custom_headers = nil) - response = begin_update_async(resource_group_name, name, parameters, custom_headers).value! + def begin_update(resource_group_name, account_name, parameters = nil, custom_headers = nil) + response = begin_update_async(resource_group_name, account_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -760,7 +768,8 @@ def begin_update(resource_group_name, name, parameters = nil, custom_headers = n # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account. - # @param name [String] The name of the Data Lake Analytics account to update. + # @param account_name [String] The name of the Data Lake Analytics account to + # update. # @param parameters [DataLakeAnalyticsAccountUpdateParameters] Parameters # supplied to the update Data Lake Analytics account operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -768,8 +777,8 @@ def begin_update(resource_group_name, name, parameters = nil, custom_headers = n # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_update_with_http_info(resource_group_name, name, parameters = nil, custom_headers = nil) - begin_update_async(resource_group_name, name, parameters, custom_headers).value! + def begin_update_with_http_info(resource_group_name, account_name, parameters = nil, custom_headers = nil) + begin_update_async(resource_group_name, account_name, parameters, custom_headers).value! end # @@ -778,7 +787,8 @@ def begin_update_with_http_info(resource_group_name, name, parameters = nil, cus # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Analytics account. - # @param name [String] The name of the Data Lake Analytics account to update. + # @param account_name [String] The name of the Data Lake Analytics account to + # update. # @param parameters [DataLakeAnalyticsAccountUpdateParameters] Parameters # supplied to the update Data Lake Analytics account operation. # @param [Hash{String => String}] A hash of custom headers that will be added @@ -786,9 +796,9 @@ def begin_update_with_http_info(resource_group_name, name, parameters = nil, cus # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_update_async(resource_group_name, name, parameters = nil, custom_headers = nil) + def begin_update_async(resource_group_name, account_name, parameters = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? @@ -806,13 +816,13 @@ def begin_update_async(resource_group_name, name, parameters = nil, custom_heade request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}' + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id}, + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/data_lake_analytics_account_management_client.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/data_lake_analytics_account_management_client.rb index 009ceadf3c..b2854bb51a 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/data_lake_analytics_account_management_client.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/data_lake_analytics_account_management_client.rb @@ -36,6 +36,9 @@ class DataLakeAnalyticsAccountManagementClient < MsRestAzure::AzureServiceClient # is generated and included in each request. Default is true. attr_accessor :generate_client_request_id + # @return [FirewallRules] firewall_rules + attr_reader :firewall_rules + # @return [StorageAccounts] storage_accounts attr_reader :storage_accounts @@ -51,14 +54,14 @@ class DataLakeAnalyticsAccountManagementClient < MsRestAzure::AzureServiceClient # @param base_url [String] the base URI of the service. # @param options [Array] filters to be applied to the HTTP requests. # - def initialize(credentials, base_url = nil, options = nil) + def initialize(credentials = nil, base_url = nil, options = nil) super(credentials, options) @base_url = base_url || 'https://management.azure.com' - fail ArgumentError, 'credentials is nil' if credentials.nil? - fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? @credentials = credentials + @firewall_rules = FirewallRules.new(self) @storage_accounts = StorageAccounts.new(self) @data_lake_store_accounts = DataLakeStoreAccounts.new(self) @account = Account.new(self) @@ -71,7 +74,7 @@ def initialize(credentials, base_url = nil, options = nil) # # Makes a request and returns the body of the response. - # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. # @param path [String] the path, relative to {base_url}. # @param options [Hash{String=>String}] specifying any request options like :body. # @return [Hash{String=>String}] containing the body of the response. @@ -132,7 +135,7 @@ def make_request_async(method, path, options = {}) def add_telemetry sdk_information = 'azure_mgmt_datalake_analytics' if defined? Azure::ARM::DataLakeAnalytics::VERSION - sdk_information = "#{sdk_information}/#{Azure::ARM::DataLakeAnalytics::VERSION}" + sdk_information = "#{sdk_information}/#{Azure::ARM::DataLakeAnalytics::VERSION}" end add_user_agent_information(sdk_information) end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/data_lake_store_accounts.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/data_lake_store_accounts.rb index cc0ffc7601..d37b03b3ad 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/data_lake_store_accounts.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/data_lake_store_accounts.rb @@ -241,7 +241,7 @@ def delete_async(resource_group_name, account_name, data_lake_store_account_name # will be added to the HTTP request. # # - def add(resource_group_name, account_name, data_lake_store_account_name, parameters, custom_headers = nil) + def add(resource_group_name, account_name, data_lake_store_account_name, parameters = nil, custom_headers = nil) response = add_async(resource_group_name, account_name, data_lake_store_account_name, parameters, custom_headers).value! nil end @@ -263,7 +263,7 @@ def add(resource_group_name, account_name, data_lake_store_account_name, paramet # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def add_with_http_info(resource_group_name, account_name, data_lake_store_account_name, parameters, custom_headers = nil) + def add_with_http_info(resource_group_name, account_name, data_lake_store_account_name, parameters = nil, custom_headers = nil) add_async(resource_group_name, account_name, data_lake_store_account_name, parameters, custom_headers).value! end @@ -284,11 +284,10 @@ def add_with_http_info(resource_group_name, account_name, data_lake_store_accoun # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def add_async(resource_group_name, account_name, data_lake_store_account_name, parameters, custom_headers = nil) + def add_async(resource_group_name, account_name, data_lake_store_account_name, parameters = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, 'data_lake_store_account_name is nil' if data_lake_store_account_name.nil? - fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/firewall_rules.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/firewall_rules.rb new file mode 100644 index 0000000000..63f0474af0 --- /dev/null +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/firewall_rules.rb @@ -0,0 +1,674 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeAnalytics + # + # Creates an Azure Data Lake Analytics account management client. + # + class FirewallRules + include Azure::ARM::DataLakeAnalytics::Models + include MsRestAzure + + # + # Creates and initializes a new instance of the FirewallRules class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DataLakeAnalyticsAccountManagementClient] reference to the DataLakeAnalyticsAccountManagementClient + attr_reader :client + + # + # Creates or updates the specified firewall rule. During update, the firewall + # rule with the specified name will be replaced with this new firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account to + # add or replace the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to create or + # update. + # @param parameters [FirewallRule] Parameters supplied to create or update the + # firewall rule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FirewallRule] operation results. + # + def create_or_update(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates the specified firewall rule. During update, the firewall + # rule with the specified name will be replaced with this new firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account to + # add or replace the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to create or + # update. + # @param parameters [FirewallRule] Parameters supplied to create or update the + # firewall rule. + # @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 create_or_update_with_http_info(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers).value! + end + + # + # Creates or updates the specified firewall rule. During update, the firewall + # rule with the specified name will be replaced with this new firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account to + # add or replace the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to create or + # update. + # @param parameters [FirewallRule] Parameters supplied to create or update the + # firewall rule. + # @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 create_or_update_async(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = FirewallRule.mapper() + request_content = @client.serialize(request_mapper, parameters, 'parameters') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'firewallRuleName' => firewall_rule_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, 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 MsRestAzure::AzureOperationError.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 = FirewallRule.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + 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 + + # + # Updates the specified firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account to + # which to update the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to update. + # @param parameters [UpdateFirewallRuleParameters] Parameters supplied to + # update the firewall rule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FirewallRule] operation results. + # + def update(resource_group_name, account_name, firewall_rule_name, parameters = nil, custom_headers = nil) + response = update_async(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates the specified firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account to + # which to update the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to update. + # @param parameters [UpdateFirewallRuleParameters] Parameters supplied to + # update the firewall rule. + # @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 update_with_http_info(resource_group_name, account_name, firewall_rule_name, parameters = nil, custom_headers = nil) + update_async(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers).value! + end + + # + # Updates the specified firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account to + # which to update the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to update. + # @param parameters [UpdateFirewallRuleParameters] Parameters supplied to + # update the firewall rule. + # @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 update_async(resource_group_name, account_name, firewall_rule_name, parameters = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = UpdateFirewallRuleParameters.mapper() + request_content = @client.serialize(request_mapper, parameters, 'parameters') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'firewallRuleName' => firewall_rule_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, 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 MsRestAzure::AzureOperationError.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 = FirewallRule.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + 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 + + # + # Deletes the specified firewall rule from the specified Data Lake Analytics + # account + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to delete the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to delete. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, account_name, firewall_rule_name, custom_headers = nil) + response = delete_async(resource_group_name, account_name, firewall_rule_name, custom_headers).value! + nil + end + + # + # Deletes the specified firewall rule from the specified Data Lake Analytics + # account + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to delete the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to delete. + # @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 delete_with_http_info(resource_group_name, account_name, firewall_rule_name, custom_headers = nil) + delete_async(resource_group_name, account_name, firewall_rule_name, custom_headers).value! + end + + # + # Deletes the specified firewall rule from the specified Data Lake Analytics + # account + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to delete the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to delete. + # @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 delete_async(resource_group_name, account_name, firewall_rule_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'firewallRuleName' => firewall_rule_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, 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 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.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? + + result + end + + promise.execute + end + + # + # Gets the specified Data Lake Analytics firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to get the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to retrieve. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FirewallRule] operation results. + # + def get(resource_group_name, account_name, firewall_rule_name, custom_headers = nil) + response = get_async(resource_group_name, account_name, firewall_rule_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the specified Data Lake Analytics firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to get the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to retrieve. + # @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_group_name, account_name, firewall_rule_name, custom_headers = nil) + get_async(resource_group_name, account_name, firewall_rule_name, custom_headers).value! + end + + # + # Gets the specified Data Lake Analytics firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to get the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to retrieve. + # @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_group_name, account_name, firewall_rule_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'firewallRuleName' => firewall_rule_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.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 MsRestAzure::AzureOperationError.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 = FirewallRule.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + 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 Data Lake Analytics firewall rules within the specified Data Lake + # Analytics account. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to get the firewall rules. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_account(resource_group_name, account_name, custom_headers = nil) + first_page = list_by_account_as_lazy(resource_group_name, account_name, custom_headers) + first_page.get_all_items + end + + # + # Lists the Data Lake Analytics firewall rules within the specified Data Lake + # Analytics account. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to get the firewall rules. + # @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_by_account_with_http_info(resource_group_name, account_name, custom_headers = nil) + list_by_account_async(resource_group_name, account_name, custom_headers).value! + end + + # + # Lists the Data Lake Analytics firewall rules within the specified Data Lake + # Analytics account. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to get the firewall rules. + # @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_by_account_async(resource_group_name, account_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.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 MsRestAzure::AzureOperationError.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 = DataLakeAnalyticsFirewallRuleListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + 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 Data Lake Analytics firewall rules within the specified Data Lake + # Analytics account. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DataLakeAnalyticsFirewallRuleListResult] operation results. + # + def list_by_account_next(next_page_link, custom_headers = nil) + response = list_by_account_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the Data Lake Analytics firewall rules within the specified Data Lake + # Analytics account. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @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_by_account_next_with_http_info(next_page_link, custom_headers = nil) + list_by_account_next_async(next_page_link, custom_headers).value! + end + + # + # Lists the Data Lake Analytics firewall rules within the specified Data Lake + # Analytics account. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @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_by_account_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + 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 MsRestAzure::AzureOperationError.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 = DataLakeAnalyticsFirewallRuleListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + 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 Data Lake Analytics firewall rules within the specified Data Lake + # Analytics account. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Analytics account. + # @param account_name [String] The name of the Data Lake Analytics account from + # which to get the firewall rules. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DataLakeAnalyticsFirewallRuleListResult] which provide lazy access + # to pages of the response. + # + def list_by_account_as_lazy(resource_group_name, account_name, custom_headers = nil) + response = list_by_account_async(resource_group_name, account_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_account_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/create_storage_account_info.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/create_storage_account_info.rb deleted file mode 100644 index 95909273eb..0000000000 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/create_storage_account_info.rb +++ /dev/null @@ -1,67 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::DataLakeAnalytics - module Models - # - # Azure Storage account information to add to the Data Lake analytics - # account being created. - # - class CreateStorageAccountInfo - - include MsRestAzure - - # @return [String] the account name associated with the Azure storage - # account to add to the Data Lake analytics account being created. - attr_accessor :name - - # @return [String] the access key associated with this Azure Storage - # account that will be used to connect to it. - attr_accessor :access_key - - # @return [String] the optional suffix for the storage account. - attr_accessor :suffix - - - # - # Mapper for CreateStorageAccountInfo class as Ruby Hash. - # This will be used for serialization/deserialization. - # - def self.mapper() - { - required: false, - serialized_name: 'CreateStorageAccountInfo', - type: { - name: 'Composite', - class_name: 'CreateStorageAccountInfo', - model_properties: { - name: { - required: true, - serialized_name: 'name', - type: { - name: 'String' - } - }, - access_key: { - required: true, - serialized_name: 'properties.accessKey', - type: { - name: 'String' - } - }, - suffix: { - required: false, - serialized_name: 'properties.suffix', - type: { - name: 'String' - } - } - } - } - } - end - end - end -end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account.rb index 33c45d6617..bc45f64f50 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account.rb @@ -66,6 +66,37 @@ class DataLakeAnalyticsAccount < MsRestAzure::Resource # @return [String] the full CName endpoint for this account. attr_accessor :endpoint + # @return [TierType] the commitment tier for the next month. Possible + # values include: 'Consumption', 'Commitment_100AUHours', + # 'Commitment_500AUHours', 'Commitment_1000AUHours', + # 'Commitment_5000AUHours', 'Commitment_10000AUHours', + # 'Commitment_50000AUHours', 'Commitment_100000AUHours', + # 'Commitment_500000AUHours' + attr_accessor :new_tier + + # @return [TierType] the commitment tier in use for the current month. + # Possible values include: 'Consumption', 'Commitment_100AUHours', + # 'Commitment_500AUHours', 'Commitment_1000AUHours', + # 'Commitment_5000AUHours', 'Commitment_10000AUHours', + # 'Commitment_50000AUHours', 'Commitment_100000AUHours', + # 'Commitment_500000AUHours' + attr_accessor :current_tier + + # @return [FirewallState] The current state of the IP address firewall + # for this Data Lake Analytics account. Possible values include: + # 'Enabled', 'Disabled' + attr_accessor :firewall_state + + # @return [FirewallAllowAzureIpsState] The current state of allowing or + # disallowing IPs originating within Azure through the firewall. If the + # firewall is disabled, this is not enforced. Possible values include: + # 'Enabled', 'Disabled' + attr_accessor :firewall_allow_azure_ips + + # @return [Array] The list of firewall rules associated + # with this Data Lake Analytics account. + attr_accessor :firewall_rules + # # Mapper for DataLakeAnalyticsAccount class as Ruby Hash. @@ -252,6 +283,54 @@ def self.mapper() type: { name: 'String' } + }, + new_tier: { + required: false, + serialized_name: 'properties.newTier', + type: { + name: 'Enum', + module: 'TierType' + } + }, + current_tier: { + required: false, + read_only: true, + serialized_name: 'properties.currentTier', + type: { + name: 'Enum', + module: 'TierType' + } + }, + firewall_state: { + required: false, + serialized_name: 'properties.firewallState', + type: { + name: 'Enum', + module: 'FirewallState' + } + }, + firewall_allow_azure_ips: { + required: false, + serialized_name: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + module: 'FirewallAllowAzureIpsState' + } + }, + firewall_rules: { + required: false, + serialized_name: 'properties.firewallRules', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'FirewallRuleElementType', + type: { + name: 'Composite', + class_name: 'FirewallRule' + } + } + } } } } diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_update_parameters.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_update_parameters.rb index e0985f70b7..9641003779 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_update_parameters.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_update_parameters.rb @@ -27,6 +27,29 @@ class DataLakeAnalyticsAccountUpdateParameters # at the same time. attr_accessor :max_job_count + # @return [TierType] the commitment tier to use for next month. Possible + # values include: 'Consumption', 'Commitment_100AUHours', + # 'Commitment_500AUHours', 'Commitment_1000AUHours', + # 'Commitment_5000AUHours', 'Commitment_10000AUHours', + # 'Commitment_50000AUHours', 'Commitment_100000AUHours', + # 'Commitment_500000AUHours' + attr_accessor :new_tier + + # @return [FirewallState] The current state of the IP address firewall + # for this Data Lake Analytics account. Possible values include: + # 'Enabled', 'Disabled' + attr_accessor :firewall_state + + # @return [FirewallAllowAzureIpsState] The current state of allowing or + # disallowing IPs originating within Azure through the firewall. If the + # firewall is disabled, this is not enforced. Possible values include: + # 'Enabled', 'Disabled' + attr_accessor :firewall_allow_azure_ips + + # @return [Array] The list of firewall rules associated + # with this Data Lake Analytics account. + attr_accessor :firewall_rules + # # Mapper for DataLakeAnalyticsAccountUpdateParameters class as Ruby Hash. @@ -84,6 +107,45 @@ def self.mapper() type: { name: 'Number' } + }, + new_tier: { + required: false, + serialized_name: 'properties.newTier', + type: { + name: 'Enum', + module: 'TierType' + } + }, + firewall_state: { + required: false, + serialized_name: 'properties.firewallState', + type: { + name: 'Enum', + module: 'FirewallState' + } + }, + firewall_allow_azure_ips: { + required: false, + serialized_name: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + module: 'FirewallAllowAzureIpsState' + } + }, + firewall_rules: { + required: false, + serialized_name: 'properties.firewallRules', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'FirewallRuleElementType', + type: { + name: 'Composite', + class_name: 'FirewallRule' + } + } + } } } } diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_firewall_rule_list_result.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_firewall_rule_list_result.rb new file mode 100644 index 0000000000..e3d716badc --- /dev/null +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_firewall_rule_list_result.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeAnalytics + module Models + # + # Data Lake Analytics firewall rule list information. + # + class DataLakeAnalyticsFirewallRuleListResult + + include MsRestAzure + + # @return [Array] the results of the list operation + attr_accessor :value + + # @return [String] the link (url) to the next page of results. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [DataLakeAnalyticsFirewallRuleListResult] with next page + # content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for DataLakeAnalyticsFirewallRuleListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DataLakeAnalyticsFirewallRuleListResult', + type: { + name: 'Composite', + class_name: 'DataLakeAnalyticsFirewallRuleListResult', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'FirewallRuleElementType', + type: { + name: 'Composite', + class_name: 'FirewallRule' + } + } + } + }, + next_link: { + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_store_account_info.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_store_account_info.rb index 9b6ed037bd..4a7457d300 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_store_account_info.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_store_account_info.rb @@ -8,14 +8,10 @@ module Models # # Data Lake Store account information. # - class DataLakeStoreAccountInfo + class DataLakeStoreAccountInfo < SubResource include MsRestAzure - # @return [String] the account name of the Data Lake Store account to add - # to the Data Lake Analytics account being created. - attr_accessor :name - # @return [String] the optional suffix for the Data Lake Store account. attr_accessor :suffix @@ -32,6 +28,14 @@ def self.mapper() name: 'Composite', class_name: 'DataLakeStoreAccountInfo', model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, name: { required: true, serialized_name: 'name', @@ -39,6 +43,14 @@ def self.mapper() name: 'String' } }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, suffix: { required: false, serialized_name: 'properties.suffix', diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/error.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/error.rb deleted file mode 100644 index 12b59e2201..0000000000 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/error.rb +++ /dev/null @@ -1,99 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::DataLakeAnalytics - module Models - # - # Generic resource error information. - # - class Error - - include MsRestAzure - - # @return [String] the HTTP status code or error code associated with - # this error - attr_accessor :code - - # @return [String] the error message to display. - attr_accessor :message - - # @return [String] the target of the error. - attr_accessor :target - - # @return [Array] The list of error details - attr_accessor :details - - # @return [InnerError] The inner exceptions or errors, if any - attr_accessor :inner_error - - - # - # Mapper for Error class as Ruby Hash. - # This will be used for serialization/deserialization. - # - def self.mapper() - { - required: false, - serialized_name: 'Error', - type: { - name: 'Composite', - class_name: 'Error', - model_properties: { - code: { - required: false, - read_only: true, - serialized_name: 'code', - type: { - name: 'String' - } - }, - message: { - required: false, - read_only: true, - serialized_name: 'message', - type: { - name: 'String' - } - }, - target: { - required: false, - read_only: true, - serialized_name: 'target', - type: { - name: 'String' - } - }, - details: { - required: false, - read_only: true, - serialized_name: 'details', - type: { - name: 'Sequence', - element: { - required: false, - serialized_name: 'ErrorDetailsElementType', - type: { - name: 'Composite', - class_name: 'ErrorDetails' - } - } - } - }, - inner_error: { - required: false, - read_only: true, - serialized_name: 'innerError', - type: { - name: 'Composite', - class_name: 'InnerError' - } - } - } - } - } - end - end - end -end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_allow_azure_ips_state.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_allow_azure_ips_state.rb new file mode 100644 index 0000000000..45ff70e7c6 --- /dev/null +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_allow_azure_ips_state.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeAnalytics + module Models + # + # Defines values for FirewallAllowAzureIpsState + # + module FirewallAllowAzureIpsState + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_rule.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_rule.rb new file mode 100644 index 0000000000..89b523a726 --- /dev/null +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_rule.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeAnalytics + module Models + # + # Data Lake Analytics firewall rule information + # + class FirewallRule < OptionalSubResource + + include MsRestAzure + + # @return [String] the start IP address for the firewall rule. This can + # be either ipv4 or ipv6. Start and End should be in the same protocol. + attr_accessor :start_ip_address + + # @return [String] the end IP address for the firewall rule. This can be + # either ipv4 or ipv6. Start and End should be in the same protocol. + attr_accessor :end_ip_address + + + # + # Mapper for FirewallRule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'FirewallRule', + type: { + name: 'Composite', + class_name: 'FirewallRule', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + start_ip_address: { + required: true, + serialized_name: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + end_ip_address: { + required: true, + serialized_name: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_state.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_state.rb new file mode 100644 index 0000000000..f694cf7c9f --- /dev/null +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/firewall_state.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeAnalytics + module Models + # + # Defines values for FirewallState + # + module FirewallState + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/error_details.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/optional_sub_resource.rb similarity index 54% rename from management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/error_details.rb rename to management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/optional_sub_resource.rb index d16ed2bac1..c24af77457 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/error_details.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/optional_sub_resource.rb @@ -6,56 +6,54 @@ module Azure::ARM::DataLakeAnalytics module Models # - # Generic resource error details information. + # The Resource model definition for a nested resource with no required + # properties. # - class ErrorDetails + class OptionalSubResource include MsRestAzure - # @return [String] the HTTP status code or error code associated with - # this error - attr_accessor :code + # @return [String] Resource Id + attr_accessor :id - # @return [String] the error message localized based on Accept-Language - attr_accessor :message + # @return [String] Resource name + attr_accessor :name - # @return [String] the target of the particular error (for example, the - # name of the property in error). - attr_accessor :target + # @return [String] Resource type + attr_accessor :type # - # Mapper for ErrorDetails class as Ruby Hash. + # Mapper for OptionalSubResource class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'ErrorDetails', + serialized_name: 'OptionalSubResource', type: { name: 'Composite', - class_name: 'ErrorDetails', + class_name: 'OptionalSubResource', model_properties: { - code: { + id: { required: false, read_only: true, - serialized_name: 'code', + serialized_name: 'id', type: { name: 'String' } }, - message: { + name: { required: false, - read_only: true, - serialized_name: 'message', + serialized_name: 'name', type: { name: 'String' } }, - target: { + type: { required: false, read_only: true, - serialized_name: 'target', + serialized_name: 'type', type: { name: 'String' } diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/storage_account_info.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/storage_account_info.rb index 603667e9c0..4507746502 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/storage_account_info.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/storage_account_info.rb @@ -8,14 +8,10 @@ module Models # # Azure Storage account information. # - class StorageAccountInfo + class StorageAccountInfo < SubResource include MsRestAzure - # @return [String] the account name associated with the Azure storage - # account. - attr_accessor :name - # @return [String] the access key associated with this Azure Storage # account that will be used to connect to it. attr_accessor :access_key @@ -36,14 +32,29 @@ def self.mapper() name: 'Composite', class_name: 'StorageAccountInfo', model_properties: { - name: { + id: { required: false, read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: true, serialized_name: 'name', type: { name: 'String' } }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, access_key: { required: true, serialized_name: 'properties.accessKey', diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/inner_error.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/sub_resource.rb similarity index 56% rename from management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/inner_error.rb rename to management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/sub_resource.rb index a4ce4e0fe2..cd3dadf25b 100644 --- a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/inner_error.rb +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/sub_resource.rb @@ -6,43 +6,50 @@ module Azure::ARM::DataLakeAnalytics module Models # - # Generic resource inner error information. + # The Sub Resource model definition. # - class InnerError + class SubResource < MsRestAzure::SubResource include MsRestAzure - # @return [String] the stack trace for the error - attr_accessor :trace + # @return [String] Resource name + attr_accessor :name - # @return [String] the context for the error message - attr_accessor :context + # @return [String] Resource type + attr_accessor :type # - # Mapper for InnerError class as Ruby Hash. + # Mapper for SubResource class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'InnerError', + serialized_name: 'SubResource', type: { name: 'Composite', - class_name: 'InnerError', + class_name: 'SubResource', model_properties: { - trace: { + id: { required: false, read_only: true, - serialized_name: 'trace', + serialized_name: 'id', type: { name: 'String' } }, - context: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { required: false, read_only: true, - serialized_name: 'context', + serialized_name: 'type', type: { name: 'String' } diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/tier_type.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/tier_type.rb new file mode 100644 index 0000000000..b5624ca913 --- /dev/null +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/tier_type.rb @@ -0,0 +1,23 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeAnalytics + module Models + # + # Defines values for TierType + # + module TierType + Consumption = "Consumption" + Commitment100AUHours = "Commitment_100AUHours" + Commitment500AUHours = "Commitment_500AUHours" + Commitment1000AUHours = "Commitment_1000AUHours" + Commitment5000AUHours = "Commitment_5000AUHours" + Commitment10000AUHours = "Commitment_10000AUHours" + Commitment50000AUHours = "Commitment_50000AUHours" + Commitment100000AUHours = "Commitment_100000AUHours" + Commitment500000AUHours = "Commitment_500000AUHours" + end + end +end diff --git a/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/update_firewall_rule_parameters.rb b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/update_firewall_rule_parameters.rb new file mode 100644 index 0000000000..45be51834b --- /dev/null +++ b/management/azure_mgmt_datalake_analytics/lib/generated/azure_mgmt_datalake_analytics/models/update_firewall_rule_parameters.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeAnalytics + module Models + # + # Data Lake Analytics firewall rule update parameters + # + class UpdateFirewallRuleParameters + + include MsRestAzure + + # @return [String] the start IP address for the firewall rule. This can + # be either ipv4 or ipv6. Start and End should be in the same protocol. + attr_accessor :start_ip_address + + # @return [String] the end IP address for the firewall rule. This can be + # either ipv4 or ipv6. Start and End should be in the same protocol. + attr_accessor :end_ip_address + + + # + # Mapper for UpdateFirewallRuleParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UpdateFirewallRuleParameters', + type: { + name: 'Composite', + class_name: 'UpdateFirewallRuleParameters', + model_properties: { + start_ip_address: { + required: false, + serialized_name: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + end_ip_address: { + required: false, + serialized_name: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store.rb index c24c60d551..2f78fbba45 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store.rb @@ -26,16 +26,17 @@ module Azure::ARM::DataLakeStore autoload :DataLakeStoreAccountManagementClient, 'generated/azure_mgmt_datalake_store/data_lake_store_account_management_client.rb' module Models - autoload :DataLakeStoreAccountUpdateParameters, 'generated/azure_mgmt_datalake_store/models/data_lake_store_account_update_parameters.rb' autoload :KeyVaultMetaInfo, 'generated/azure_mgmt_datalake_store/models/key_vault_meta_info.rb' + autoload :EncryptionConfig, 'generated/azure_mgmt_datalake_store/models/encryption_config.rb' + autoload :UpdateFirewallRuleParameters, 'generated/azure_mgmt_datalake_store/models/update_firewall_rule_parameters.rb' + autoload :UpdateTrustedIdProviderParameters, 'generated/azure_mgmt_datalake_store/models/update_trusted_id_provider_parameters.rb' + autoload :SubResource, 'generated/azure_mgmt_datalake_store/models/sub_resource.rb' autoload :DataLakeStoreTrustedIdProviderListResult, 'generated/azure_mgmt_datalake_store/models/data_lake_store_trusted_id_provider_list_result.rb' + autoload :DataLakeStoreAccountUpdateParameters, 'generated/azure_mgmt_datalake_store/models/data_lake_store_account_update_parameters.rb' autoload :EncryptionIdentity, 'generated/azure_mgmt_datalake_store/models/encryption_identity.rb' + autoload :DataLakeStoreFirewallRuleListResult, 'generated/azure_mgmt_datalake_store/models/data_lake_store_firewall_rule_list_result.rb' autoload :DataLakeStoreAccountListResult, 'generated/azure_mgmt_datalake_store/models/data_lake_store_account_list_result.rb' autoload :ErrorDetails, 'generated/azure_mgmt_datalake_store/models/error_details.rb' - autoload :EncryptionConfig, 'generated/azure_mgmt_datalake_store/models/encryption_config.rb' - autoload :InnerError, 'generated/azure_mgmt_datalake_store/models/inner_error.rb' - autoload :DataLakeStoreFirewallRuleListResult, 'generated/azure_mgmt_datalake_store/models/data_lake_store_firewall_rule_list_result.rb' - autoload :Error, 'generated/azure_mgmt_datalake_store/models/error.rb' autoload :FirewallRule, 'generated/azure_mgmt_datalake_store/models/firewall_rule.rb' autoload :TrustedIdProvider, 'generated/azure_mgmt_datalake_store/models/trusted_id_provider.rb' autoload :DataLakeStoreAccount, 'generated/azure_mgmt_datalake_store/models/data_lake_store_account.rb' @@ -45,6 +46,8 @@ module Models autoload :EncryptionState, 'generated/azure_mgmt_datalake_store/models/encryption_state.rb' autoload :EncryptionProvisioningState, 'generated/azure_mgmt_datalake_store/models/encryption_provisioning_state.rb' autoload :FirewallState, 'generated/azure_mgmt_datalake_store/models/firewall_state.rb' + autoload :FirewallAllowAzureIpsState, 'generated/azure_mgmt_datalake_store/models/firewall_allow_azure_ips_state.rb' autoload :TrustedIdProviderState, 'generated/azure_mgmt_datalake_store/models/trusted_id_provider_state.rb' + autoload :TierType, 'generated/azure_mgmt_datalake_store/models/tier_type.rb' end end diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/account.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/account.rb index 4b65017d74..80a929c049 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/account.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/account.rb @@ -123,30 +123,28 @@ def update_async(resource_group_name, name, parameters, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to - # delete. + # @param name [String] The name of the Data Lake Store account to delete. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - def delete(resource_group_name, account_name, custom_headers = nil) - response = delete_async(resource_group_name, account_name, custom_headers).value! + def delete(resource_group_name, name, custom_headers = nil) + response = delete_async(resource_group_name, name, custom_headers).value! nil end # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to - # delete. + # @param name [String] The name of the Data Lake Store account to delete. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [Concurrent::Promise] promise which provides async access to http # response. # - def delete_async(resource_group_name, account_name, custom_headers = nil) + def delete_async(resource_group_name, name, custom_headers = nil) # Send request - promise = begin_delete_async(resource_group_name, account_name, custom_headers) + promise = begin_delete_async(resource_group_name, name, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -165,15 +163,14 @@ def delete_async(resource_group_name, account_name, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to - # retrieve. + # @param name [String] The name of the Data Lake Store account to retrieve. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [DataLakeStoreAccount] operation results. # - def get(resource_group_name, account_name, custom_headers = nil) - response = get_async(resource_group_name, account_name, custom_headers).value! + def get(resource_group_name, name, custom_headers = nil) + response = get_async(resource_group_name, name, custom_headers).value! response.body unless response.nil? end @@ -182,15 +179,14 @@ def get(resource_group_name, account_name, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to - # retrieve. + # @param name [String] The name of the Data Lake Store account to retrieve. # @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_group_name, account_name, custom_headers = nil) - get_async(resource_group_name, account_name, custom_headers).value! + def get_with_http_info(resource_group_name, name, custom_headers = nil) + get_async(resource_group_name, name, custom_headers).value! end # @@ -198,16 +194,15 @@ def get_with_http_info(resource_group_name, account_name, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to - # retrieve. + # @param name [String] The name of the Data Lake Store account to retrieve. # @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_group_name, account_name, custom_headers = nil) + def get_async(resource_group_name, name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? @@ -217,13 +212,13 @@ def get_async(resource_group_name, account_name, custom_headers = nil) # 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}' + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id}, + path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -854,14 +849,13 @@ def begin_update_async(resource_group_name, name, parameters, custom_headers = n # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to - # delete. + # @param name [String] The name of the Data Lake Store account to delete. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # - def begin_delete(resource_group_name, account_name, custom_headers = nil) - response = begin_delete_async(resource_group_name, account_name, custom_headers).value! + def begin_delete(resource_group_name, name, custom_headers = nil) + response = begin_delete_async(resource_group_name, name, custom_headers).value! nil end @@ -870,15 +864,14 @@ def begin_delete(resource_group_name, account_name, custom_headers = nil) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to - # delete. + # @param name [String] The name of the Data Lake Store account to delete. # @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 begin_delete_with_http_info(resource_group_name, account_name, custom_headers = nil) - begin_delete_async(resource_group_name, account_name, custom_headers).value! + def begin_delete_with_http_info(resource_group_name, name, custom_headers = nil) + begin_delete_async(resource_group_name, name, custom_headers).value! end # @@ -886,16 +879,15 @@ def begin_delete_with_http_info(resource_group_name, account_name, custom_header # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to - # delete. + # @param name [String] The name of the Data Lake Store account to delete. # @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 begin_delete_async(resource_group_name, account_name, custom_headers = nil) + def begin_delete_async(resource_group_name, name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? @@ -905,13 +897,13 @@ def begin_delete_async(resource_group_name, account_name, custom_headers = nil) # 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}' + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id}, + path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/data_lake_store_account_management_client.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/data_lake_store_account_management_client.rb index 24861928e3..177fa77256 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/data_lake_store_account_management_client.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/data_lake_store_account_management_client.rb @@ -51,12 +51,11 @@ class DataLakeStoreAccountManagementClient < MsRestAzure::AzureServiceClient # @param base_url [String] the base URI of the service. # @param options [Array] filters to be applied to the HTTP requests. # - def initialize(credentials, base_url = nil, options = nil) + def initialize(credentials = nil, base_url = nil, options = nil) super(credentials, options) @base_url = base_url || 'https://management.azure.com' - fail ArgumentError, 'credentials is nil' if credentials.nil? - fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? @credentials = credentials @firewall_rules = FirewallRules.new(self) @@ -71,7 +70,7 @@ def initialize(credentials, base_url = nil, options = nil) # # Makes a request and returns the body of the response. - # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. # @param path [String] the path, relative to {base_url}. # @param options [Hash{String=>String}] specifying any request options like :body. # @return [Hash{String=>String}] containing the body of the response. @@ -132,7 +131,7 @@ def make_request_async(method, path, options = {}) def add_telemetry sdk_information = 'azure_mgmt_datalake_store' if defined? Azure::ARM::DataLakeStore::VERSION - sdk_information = "#{sdk_information}/#{Azure::ARM::DataLakeStore::VERSION}" + sdk_information = "#{sdk_information}/#{Azure::ARM::DataLakeStore::VERSION}" end add_user_agent_information(sdk_information) end diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/firewall_rules.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/firewall_rules.rb index df390dc30c..0547bd17fb 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/firewall_rules.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/firewall_rules.rb @@ -28,8 +28,8 @@ def initialize(client) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to which - # to add the firewall rule. + # @param account_name [String] The name of the Data Lake Store account to add + # or replace the firewall rule. # @param firewall_rule_name [String] The name of the firewall rule to create or # update. # @param parameters [FirewallRule] Parameters supplied to create or update the @@ -50,8 +50,8 @@ def create_or_update(resource_group_name, account_name, firewall_rule_name, para # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to which - # to add the firewall rule. + # @param account_name [String] The name of the Data Lake Store account to add + # or replace the firewall rule. # @param firewall_rule_name [String] The name of the firewall rule to create or # update. # @param parameters [FirewallRule] Parameters supplied to create or update the @@ -71,8 +71,8 @@ def create_or_update_with_http_info(resource_group_name, account_name, firewall_ # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to which - # to add the firewall rule. + # @param account_name [String] The name of the Data Lake Store account to add + # or replace the firewall rule. # @param firewall_rule_name [String] The name of the firewall rule to create or # update. # @param parameters [FirewallRule] Parameters supplied to create or update the @@ -145,6 +145,122 @@ def create_or_update_async(resource_group_name, account_name, firewall_rule_name promise.execute end + # + # Updates the specified firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Store account. + # @param account_name [String] The name of the Data Lake Store account to which + # to update the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to update. + # @param parameters [UpdateFirewallRuleParameters] Parameters supplied to + # update the firewall rule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FirewallRule] operation results. + # + def update(resource_group_name, account_name, firewall_rule_name, parameters = nil, custom_headers = nil) + response = update_async(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates the specified firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Store account. + # @param account_name [String] The name of the Data Lake Store account to which + # to update the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to update. + # @param parameters [UpdateFirewallRuleParameters] Parameters supplied to + # update the firewall rule. + # @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 update_with_http_info(resource_group_name, account_name, firewall_rule_name, parameters = nil, custom_headers = nil) + update_async(resource_group_name, account_name, firewall_rule_name, parameters, custom_headers).value! + end + + # + # Updates the specified firewall rule. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Store account. + # @param account_name [String] The name of the Data Lake Store account to which + # to update the firewall rule. + # @param firewall_rule_name [String] The name of the firewall rule to update. + # @param parameters [UpdateFirewallRuleParameters] Parameters supplied to + # update the firewall rule. + # @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 update_async(resource_group_name, account_name, firewall_rule_name, parameters = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = UpdateFirewallRuleParameters.mapper() + request_content = @client.serialize(request_mapper, parameters, 'parameters') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'firewallRuleName' => firewall_rule_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, 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 MsRestAzure::AzureOperationError.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 = FirewallRule.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + 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 + # # Deletes the specified firewall rule from the specified Data Lake Store # account diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/data_lake_store_account.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/data_lake_store_account.rb index 0486334be5..7e7eb6fcb3 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/data_lake_store_account.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/data_lake_store_account.rb @@ -46,6 +46,12 @@ class DataLakeStoreAccount < MsRestAzure::Resource # 'Disabled' attr_accessor :firewall_state + # @return [FirewallAllowAzureIpsState] The current state of allowing or + # disallowing IPs originating within Azure through the firewall. If the + # firewall is disabled, this is not enforced. Possible values include: + # 'Enabled', 'Disabled' + attr_accessor :firewall_allow_azure_ips + # @return [Array] The list of firewall rules associated # with this Data Lake store account. attr_accessor :firewall_rules @@ -69,6 +75,18 @@ class DataLakeStoreAccount < MsRestAzure::Resource # created in the Data Lake Store account. attr_accessor :default_group + # @return [TierType] the commitment tier to use for next month. Possible + # values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', + # 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + # 'Commitment_5PB' + attr_accessor :new_tier + + # @return [TierType] the commitment tier in use for the current month. + # Possible values include: 'Consumption', 'Commitment_1TB', + # 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', + # 'Commitment_1PB', 'Commitment_5PB' + attr_accessor :current_tier + # # Mapper for DataLakeStoreAccount class as Ruby Hash. @@ -194,6 +212,14 @@ def self.mapper() module: 'FirewallState' } }, + firewall_allow_azure_ips: { + required: false, + serialized_name: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + module: 'FirewallAllowAzureIpsState' + } + }, firewall_rules: { required: false, serialized_name: 'properties.firewallRules', @@ -254,6 +280,23 @@ def self.mapper() type: { name: 'String' } + }, + new_tier: { + required: false, + serialized_name: 'properties.newTier', + type: { + name: 'Enum', + module: 'TierType' + } + }, + current_tier: { + required: false, + read_only: true, + serialized_name: 'properties.currentTier', + type: { + name: 'Enum', + module: 'TierType' + } } } } diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/data_lake_store_account_update_parameters.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/data_lake_store_account_update_parameters.rb index 827a570437..70fa81285e 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/data_lake_store_account_update_parameters.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/data_lake_store_account_update_parameters.rb @@ -21,6 +21,12 @@ class DataLakeStoreAccountUpdateParameters # re-enabled. Possible values include: 'Enabled', 'Disabled' attr_accessor :firewall_state + # @return [FirewallAllowAzureIpsState] The current state of allowing or + # disallowing IPs originating within Azure through the firewall. If the + # firewall is disabled, this is not enforced. Possible values include: + # 'Enabled', 'Disabled' + attr_accessor :firewall_allow_azure_ips + # @return [TrustedIdProviderState] The current state of the trusted # identity provider feature for this Data Lake store account. Disabling # trusted identity provider functionality does not remove the providers, @@ -32,6 +38,12 @@ class DataLakeStoreAccountUpdateParameters # created in the Data Lake Store account. attr_accessor :default_group + # @return [TierType] the commitment tier to use for next month. Possible + # values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', + # 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + # 'Commitment_5PB' + attr_accessor :new_tier + # # Mapper for DataLakeStoreAccountUpdateParameters class as Ruby Hash. @@ -67,6 +79,14 @@ def self.mapper() module: 'FirewallState' } }, + firewall_allow_azure_ips: { + required: false, + serialized_name: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + module: 'FirewallAllowAzureIpsState' + } + }, trusted_id_provider_state: { required: false, serialized_name: 'properties.trustedIdProviderState', @@ -81,6 +101,14 @@ def self.mapper() type: { name: 'String' } + }, + new_tier: { + required: false, + serialized_name: 'properties.newTier', + type: { + name: 'Enum', + module: 'TierType' + } } } } diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/error.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/error.rb deleted file mode 100644 index f4c0ffabf8..0000000000 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/error.rb +++ /dev/null @@ -1,99 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::DataLakeStore - module Models - # - # Data Lake Store error information - # - class Error - - include MsRestAzure - - # @return [String] the HTTP status code or error code associated with - # this error - attr_accessor :code - - # @return [String] the error message to display. - attr_accessor :message - - # @return [String] the target of the error. - attr_accessor :target - - # @return [Array] the list of error details - attr_accessor :details - - # @return [InnerError] the inner exceptions or errors, if any - attr_accessor :inner_error - - - # - # Mapper for Error class as Ruby Hash. - # This will be used for serialization/deserialization. - # - def self.mapper() - { - required: false, - serialized_name: 'Error', - type: { - name: 'Composite', - class_name: 'Error', - model_properties: { - code: { - required: false, - read_only: true, - serialized_name: 'code', - type: { - name: 'String' - } - }, - message: { - required: false, - read_only: true, - serialized_name: 'message', - type: { - name: 'String' - } - }, - target: { - required: false, - read_only: true, - serialized_name: 'target', - type: { - name: 'String' - } - }, - details: { - required: false, - read_only: true, - serialized_name: 'details', - type: { - name: 'Sequence', - element: { - required: false, - serialized_name: 'ErrorDetailsElementType', - type: { - name: 'Composite', - class_name: 'ErrorDetails' - } - } - } - }, - inner_error: { - required: false, - read_only: true, - serialized_name: 'innerError', - type: { - name: 'Composite', - class_name: 'InnerError' - } - } - } - } - } - end - end - end -end diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/firewall_allow_azure_ips_state.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/firewall_allow_azure_ips_state.rb new file mode 100644 index 0000000000..3640cb5a4e --- /dev/null +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/firewall_allow_azure_ips_state.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeStore + module Models + # + # Defines values for FirewallAllowAzureIpsState + # + module FirewallAllowAzureIpsState + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/firewall_rule.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/firewall_rule.rb index 5078c005ac..331dded8f4 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/firewall_rule.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/firewall_rule.rb @@ -8,14 +8,16 @@ module Models # # Data Lake Store firewall rule information # - class FirewallRule < MsRestAzure::SubResource + class FirewallRule < SubResource include MsRestAzure - # @return [String] the start IP address for the firewall rule. + # @return [String] the start IP address for the firewall rule. This can + # be either ipv4 or ipv6. Start and End should be in the same protocol. attr_accessor :start_ip_address - # @return [String] the end IP address for the firewall rule. + # @return [String] the end IP address for the firewall rule. This can be + # either ipv4 or ipv6. Start and End should be in the same protocol. attr_accessor :end_ip_address diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/inner_error.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/sub_resource.rb similarity index 55% rename from management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/inner_error.rb rename to management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/sub_resource.rb index f183c34c06..b94d9cdce8 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/inner_error.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/sub_resource.rb @@ -6,43 +6,50 @@ module Azure::ARM::DataLakeStore module Models # - # Data Lake Store inner error information + # The Resource model definition for a nested resource. # - class InnerError + class SubResource < MsRestAzure::SubResource include MsRestAzure - # @return [String] the stack trace for the error - attr_accessor :trace + # @return [String] Resource name + attr_accessor :name - # @return [String] the context for the error message - attr_accessor :context + # @return [String] Resource type + attr_accessor :type # - # Mapper for InnerError class as Ruby Hash. + # Mapper for SubResource class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'InnerError', + serialized_name: 'SubResource', type: { name: 'Composite', - class_name: 'InnerError', + class_name: 'SubResource', model_properties: { - trace: { + id: { required: false, read_only: true, - serialized_name: 'trace', + serialized_name: 'id', type: { name: 'String' } }, - context: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { required: false, read_only: true, - serialized_name: 'context', + serialized_name: 'type', type: { name: 'String' } diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/tier_type.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/tier_type.rb new file mode 100644 index 0000000000..f82931969b --- /dev/null +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/tier_type.rb @@ -0,0 +1,21 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeStore + module Models + # + # Defines values for TierType + # + module TierType + Consumption = "Consumption" + Commitment1TB = "Commitment_1TB" + Commitment10TB = "Commitment_10TB" + Commitment100TB = "Commitment_100TB" + Commitment500TB = "Commitment_500TB" + Commitment1PB = "Commitment_1PB" + Commitment5PB = "Commitment_5PB" + end + end +end diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/trusted_id_provider.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/trusted_id_provider.rb index 61b4d9ccf6..274c0affd2 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/trusted_id_provider.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/trusted_id_provider.rb @@ -6,9 +6,9 @@ module Azure::ARM::DataLakeStore module Models # - # Data Lake Store firewall rule information + # Data Lake Store Trusted Identity Provider information # - class TrustedIdProvider < MsRestAzure::SubResource + class TrustedIdProvider < SubResource include MsRestAzure diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/update_firewall_rule_parameters.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/update_firewall_rule_parameters.rb new file mode 100644 index 0000000000..39fee6b15e --- /dev/null +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/update_firewall_rule_parameters.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeStore + module Models + # + # Data Lake Analytics firewall rule update parameters + # + class UpdateFirewallRuleParameters + + include MsRestAzure + + # @return [String] the start IP address for the firewall rule. This can + # be either ipv4 or ipv6. Start and End should be in the same protocol. + attr_accessor :start_ip_address + + # @return [String] the end IP address for the firewall rule. This can be + # either ipv4 or ipv6. Start and End should be in the same protocol. + attr_accessor :end_ip_address + + + # + # Mapper for UpdateFirewallRuleParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UpdateFirewallRuleParameters', + type: { + name: 'Composite', + class_name: 'UpdateFirewallRuleParameters', + model_properties: { + start_ip_address: { + required: false, + serialized_name: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + end_ip_address: { + required: false, + serialized_name: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/update_trusted_id_provider_parameters.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/update_trusted_id_provider_parameters.rb new file mode 100644 index 0000000000..777e1b2ab3 --- /dev/null +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/models/update_trusted_id_provider_parameters.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::DataLakeStore + module Models + # + # Data Lake Store Trusted Identity Provider update parameters + # + class UpdateTrustedIdProviderParameters + + include MsRestAzure + + # @return [String] The URL of this trusted identity provider + attr_accessor :id_provider + + + # + # Mapper for UpdateTrustedIdProviderParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UpdateTrustedIdProviderParameters', + type: { + name: 'Composite', + class_name: 'UpdateTrustedIdProviderParameters', + model_properties: { + id_provider: { + required: false, + serialized_name: 'properties.idProvider', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/trusted_id_providers.rb b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/trusted_id_providers.rb index 25f7c504c6..d069b86d05 100644 --- a/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/trusted_id_providers.rb +++ b/management/azure_mgmt_datalake_store/lib/generated/azure_mgmt_datalake_store/trusted_id_providers.rb @@ -29,12 +29,12 @@ def initialize(client) # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to which - # to add the trusted identity provider. + # @param account_name [String] The name of the Data Lake Store account to add + # or replace the trusted identity provider. # @param trusted_id_provider_name [String] The name of the trusted identity # provider. This is used for differentiation of providers in the account. - # @param parameters [TrustedIdProvider] Parameters supplied to create the - # create the trusted identity provider. + # @param parameters [TrustedIdProvider] Parameters supplied to create or + # replace the trusted identity provider. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -52,12 +52,12 @@ def create_or_update(resource_group_name, account_name, trusted_id_provider_name # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to which - # to add the trusted identity provider. + # @param account_name [String] The name of the Data Lake Store account to add + # or replace the trusted identity provider. # @param trusted_id_provider_name [String] The name of the trusted identity # provider. This is used for differentiation of providers in the account. - # @param parameters [TrustedIdProvider] Parameters supplied to create the - # create the trusted identity provider. + # @param parameters [TrustedIdProvider] Parameters supplied to create or + # replace the trusted identity provider. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -74,12 +74,12 @@ def create_or_update_with_http_info(resource_group_name, account_name, trusted_i # # @param resource_group_name [String] The name of the Azure resource group that # contains the Data Lake Store account. - # @param account_name [String] The name of the Data Lake Store account to which - # to add the trusted identity provider. + # @param account_name [String] The name of the Data Lake Store account to add + # or replace the trusted identity provider. # @param trusted_id_provider_name [String] The name of the trusted identity # provider. This is used for differentiation of providers in the account. - # @param parameters [TrustedIdProvider] Parameters supplied to create the - # create the trusted identity provider. + # @param parameters [TrustedIdProvider] Parameters supplied to create or + # replace the trusted identity provider. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # @@ -148,6 +148,125 @@ def create_or_update_async(resource_group_name, account_name, trusted_id_provide promise.execute end + # + # Updates the specified trusted identity provider. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Store account. + # @param account_name [String] The name of the Data Lake Store account to which + # to update the trusted identity provider. + # @param trusted_id_provider_name [String] The name of the trusted identity + # provider. This is used for differentiation of providers in the account. + # @param parameters [UpdateTrustedIdProviderParameters] Parameters supplied to + # update the trusted identity provider. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TrustedIdProvider] operation results. + # + def update(resource_group_name, account_name, trusted_id_provider_name, parameters = nil, custom_headers = nil) + response = update_async(resource_group_name, account_name, trusted_id_provider_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates the specified trusted identity provider. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Store account. + # @param account_name [String] The name of the Data Lake Store account to which + # to update the trusted identity provider. + # @param trusted_id_provider_name [String] The name of the trusted identity + # provider. This is used for differentiation of providers in the account. + # @param parameters [UpdateTrustedIdProviderParameters] Parameters supplied to + # update the trusted identity provider. + # @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 update_with_http_info(resource_group_name, account_name, trusted_id_provider_name, parameters = nil, custom_headers = nil) + update_async(resource_group_name, account_name, trusted_id_provider_name, parameters, custom_headers).value! + end + + # + # Updates the specified trusted identity provider. + # + # @param resource_group_name [String] The name of the Azure resource group that + # contains the Data Lake Store account. + # @param account_name [String] The name of the Data Lake Store account to which + # to update the trusted identity provider. + # @param trusted_id_provider_name [String] The name of the trusted identity + # provider. This is used for differentiation of providers in the account. + # @param parameters [UpdateTrustedIdProviderParameters] Parameters supplied to + # update the trusted identity provider. + # @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 update_async(resource_group_name, account_name, trusted_id_provider_name, parameters = nil, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'account_name is nil' if account_name.nil? + fail ArgumentError, 'trusted_id_provider_name is nil' if trusted_id_provider_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = UpdateTrustedIdProviderParameters.mapper() + request_content = @client.serialize(request_mapper, parameters, 'parameters') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'trustedIdProviderName' => trusted_id_provider_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, 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 MsRestAzure::AzureOperationError.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 = TrustedIdProvider.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + 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 + # # Deletes the specified trusted identity provider from the specified Data Lake # Store account