class Azure::StreamAnalytics::Mgmt::V2016_03_01::Inputs
Stream Analytics Client
Attributes
@return [StreamAnalyticsManagementClient] reference to the StreamAnalyticsManagementClient
Private Class Methods
Creates and initializes a new instance of the Inputs
class. @param client service class for accessing basic functionality.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 17 def initialize(client) @client = client end
Private Instance Methods
Tests whether an input’s datasource is reachable and usable by the Azure
Stream Analytics service.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param input [Input] If the input specified does not already exist, this parameter must contain the full input definition intended to be tested. If the input specified already exists, this parameter can be left null to test the existing input as is or if specified, the properties specified will overwrite the corresponding properties in the existing input (exactly like a PATCH operation) and the resulting input will be tested. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ResourceTestStatus] operation results.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 698 def begin_test(resource_group_name, job_name, input_name, input:nil, custom_headers:nil) response = begin_test_async(resource_group_name, job_name, input_name, input:input, custom_headers:custom_headers).value! response.body unless response.nil? end
Tests whether an input’s datasource is reachable and usable by the Azure
Stream Analytics service.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param input [Input] If the input specified does not already exist, this parameter must contain the full input definition intended to be tested. If the input specified already exists, this parameter can be left null to test the existing input as is or if specified, the properties specified will overwrite the corresponding properties in the existing input (exactly like a PATCH operation) and the resulting input will be tested. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 747 def begin_test_async(resource_group_name, job_name, input_name, input:nil, custom_headers: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? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'job_name is nil' if job_name.nil? fail ArgumentError, 'input_name is nil' if input_name.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::Input.mapper() request_content = @client.serialize(request_mapper, input) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/inputs/{inputName}/test' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name,'inputName' => input_name}, 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(:post, 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 == 202 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 = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::ResourceTestStatus.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Tests whether an input’s datasource is reachable and usable by the Azure
Stream Analytics service.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param input [Input] If the input specified does not already exist, this parameter must contain the full input definition intended to be tested. If the input specified already exists, this parameter can be left null to test the existing input as is or if specified, the properties specified will overwrite the corresponding properties in the existing input (exactly like a PATCH operation) and the resulting input will be tested. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 723 def begin_test_with_http_info(resource_group_name, job_name, input_name, input:nil, custom_headers:nil) begin_test_async(resource_group_name, job_name, input_name, input:input, custom_headers:custom_headers).value! end
Creates an input or replaces an already existing input under an existing streaming job.
@param input [Input] The definition of the input that will be used to create a new input or replace the existing one under the streaming job. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param if_match [String] The ETag of the input. Omit this value to always overwrite the current input. Specify the last-seen ETag value to prevent accidentally overwritting concurrent changes. @param if_none_match [String] Set to '*' to allow a new input to be created, but to prevent updating an existing input. Other values will result in a 412 Pre-condition Failed response. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Input] operation results.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 46 def create_or_replace(input, resource_group_name, job_name, input_name, if_match:nil, if_none_match:nil, custom_headers:nil) response = create_or_replace_async(input, resource_group_name, job_name, input_name, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates an input or replaces an already existing input under an existing streaming job.
@param input [Input] The definition of the input that will be used to create a new input or replace the existing one under the streaming job. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param if_match [String] The ETag of the input. Omit this value to always overwrite the current input. Specify the last-seen ETag value to prevent accidentally overwritting concurrent changes. @param if_none_match [String] Set to '*' to allow a new input to be created, but to prevent updating an existing input. Other values will result in a 412 Pre-condition Failed response. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 99 def create_or_replace_async(input, resource_group_name, job_name, input_name, if_match:nil, if_none_match:nil, custom_headers:nil) fail ArgumentError, 'input is nil' if input.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? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'job_name is nil' if job_name.nil? fail ArgumentError, 'input_name is nil' if input_name.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['If-None-Match'] = if_none_match unless if_none_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::Input.mapper() request_content = @client.serialize(request_mapper, input) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/inputs/{inputName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name,'inputName' => input_name}, 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 || status_code == 201 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 = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::Input.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::Input.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates an input or replaces an already existing input under an existing streaming job.
@param input [Input] The definition of the input that will be used to create a new input or replace the existing one under the streaming job. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param if_match [String] The ETag of the input. Omit this value to always overwrite the current input. Specify the last-seen ETag value to prevent accidentally overwritting concurrent changes. @param if_none_match [String] Set to '*' to allow a new input to be created, but to prevent updating an existing input. Other values will result in a 412 Pre-condition Failed response. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 73 def create_or_replace_with_http_info(input, resource_group_name, job_name, input_name, if_match:nil, if_none_match:nil, custom_headers:nil) create_or_replace_async(input, resource_group_name, job_name, input_name, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value! end
Deletes an input from the streaming job.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 326 def delete(resource_group_name, job_name, input_name, custom_headers:nil) response = delete_async(resource_group_name, job_name, input_name, custom_headers:custom_headers).value! nil end
Deletes an input from the streaming job.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 361 def delete_async(resource_group_name, job_name, input_name, custom_headers: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? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'job_name is nil' if job_name.nil? fail ArgumentError, 'input_name is nil' if input_name.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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.StreamAnalytics/streamingjobs/{jobName}/inputs/{inputName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name,'inputName' => input_name}, 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
Deletes an input from the streaming job.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 344 def delete_with_http_info(resource_group_name, job_name, input_name, custom_headers:nil) delete_async(resource_group_name, job_name, input_name, custom_headers:custom_headers).value! end
Gets details about the specified input.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Input] operation results.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 418 def get(resource_group_name, job_name, input_name, custom_headers:nil) response = get_async(resource_group_name, job_name, input_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets details about the specified input.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 453 def get_async(resource_group_name, job_name, input_name, custom_headers: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? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'job_name is nil' if job_name.nil? fail ArgumentError, 'input_name is nil' if input_name.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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.StreamAnalytics/streamingjobs/{jobName}/inputs/{inputName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name,'inputName' => input_name}, 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 = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::Input.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets details about the specified input.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 436 def get_with_http_info(resource_group_name, job_name, input_name, custom_headers:nil) get_async(resource_group_name, job_name, input_name, custom_headers:custom_headers).value! end
Lists all of the inputs under the specified streaming job.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param select [String] The $select OData query parameter. This is a comma-separated list of structural properties to include in the response, or “*” to include all properties. By default, all properties are returned except diagnostics. Currently only accepts '*' as a valid value. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<Input>] operation results.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 523 def list_by_streaming_job(resource_group_name, job_name, select:nil, custom_headers:nil) first_page = list_by_streaming_job_as_lazy(resource_group_name, job_name, select:select, custom_headers:custom_headers) first_page.get_all_items end
Lists all of the inputs under the specified streaming job.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param select [String] The $select OData query parameter. This is a comma-separated list of structural properties to include in the response, or “*” to include all properties. By default, all properties are returned except diagnostics. Currently only accepts '*' as a valid value. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [InputListResult] which provide lazy access to pages of the response.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 912 def list_by_streaming_job_as_lazy(resource_group_name, job_name, select:nil, custom_headers:nil) response = list_by_streaming_job_async(resource_group_name, job_name, select:select, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_streaming_job_next_async(next_page_link, custom_headers:custom_headers) end page end end
Lists all of the inputs under the specified streaming job.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param select [String] The $select OData query parameter. This is a comma-separated list of structural properties to include in the response, or “*” to include all properties. By default, all properties are returned except diagnostics. Currently only accepts '*' as a valid value. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 564 def list_by_streaming_job_async(resource_group_name, job_name, select:nil, custom_headers: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? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'job_name is nil' if job_name.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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.StreamAnalytics/streamingjobs/{jobName}/inputs' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name}, query_params: {'$select' => select,'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 = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::InputListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists all of the inputs under the specified streaming job.
@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 [InputListResult] operation results.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 818 def list_by_streaming_job_next(next_page_link, custom_headers:nil) response = list_by_streaming_job_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists all of the inputs under the specified streaming job.
@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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 847 def list_by_streaming_job_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::InputListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists all of the inputs under the specified streaming job.
@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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 833 def list_by_streaming_job_next_with_http_info(next_page_link, custom_headers:nil) list_by_streaming_job_next_async(next_page_link, custom_headers:custom_headers).value! end
Lists all of the inputs under the specified streaming job.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param select [String] The $select OData query parameter. This is a comma-separated list of structural properties to include in the response, or “*” to include all properties. By default, all properties are returned except diagnostics. Currently only accepts '*' as a valid value. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 544 def list_by_streaming_job_with_http_info(resource_group_name, job_name, select:nil, custom_headers:nil) list_by_streaming_job_async(resource_group_name, job_name, select:select, custom_headers:custom_headers).value! end
Tests whether an input’s datasource is reachable and usable by the Azure
Stream Analytics service.
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param input [Input] If the input specified does not already exist, this parameter must contain the full input definition intended to be tested. If the input specified already exists, this parameter can be left null to test the existing input as is or if specified, the properties specified will overwrite the corresponding properties in the existing input (exactly like a PATCH operation) and the resulting input will be tested. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ResourceTestStatus] operation results.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 637 def test(resource_group_name, job_name, input_name, input:nil, custom_headers:nil) response = test_async(resource_group_name, job_name, input_name, input:input, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param input [Input] If the input specified does not already exist, this parameter must contain the full input definition intended to be tested. If the input specified already exists, this parameter can be left null to test the existing input as is or if specified, the properties specified will overwrite the corresponding properties in the existing input (exactly like a PATCH operation) and the resulting input will be tested. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 660 def test_async(resource_group_name, job_name, input_name, input:nil, custom_headers:nil) # Send request promise = begin_test_async(resource_group_name, job_name, input_name, input:input, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::ResourceTestStatus.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Updates an existing input under an existing streaming job. This can be used to partially update (ie. update one or two properties) an input without affecting the rest the job or input definition.
@param input [Input] An Input object. The properties specified here will overwrite the corresponding properties in the existing input (ie. Those properties will be updated). Any properties that are set to null here will mean that the corresponding property in the existing input will remain the same and not change as a result of this PATCH operation. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param if_match [String] The ETag of the input. Omit this value to always overwrite the current input. Specify the last-seen ETag value to prevent accidentally overwritting concurrent changes. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Input] operation results.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 196 def update(input, resource_group_name, job_name, input_name, if_match:nil, custom_headers:nil) response = update_async(input, resource_group_name, job_name, input_name, if_match:if_match, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates an existing input under an existing streaming job. This can be used to partially update (ie. update one or two properties) an input without affecting the rest the job or input definition.
@param input [Input] An Input object. The properties specified here will overwrite the corresponding properties in the existing input (ie. Those properties will be updated). Any properties that are set to null here will mean that the corresponding property in the existing input will remain the same and not change as a result of this PATCH operation. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param if_match [String] The ETag of the input. Omit this value to always overwrite the current input. Specify the last-seen ETag value to prevent accidentally overwritting concurrent changes. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 251 def update_async(input, resource_group_name, job_name, input_name, if_match:nil, custom_headers:nil) fail ArgumentError, 'input is nil' if input.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? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'job_name is nil' if job_name.nil? fail ArgumentError, 'input_name is nil' if input_name.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::Input.mapper() request_content = @client.serialize(request_mapper, input) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/inputs/{inputName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name,'inputName' => input_name}, 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 = Azure::StreamAnalytics::Mgmt::V2016_03_01::Models::Input.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Updates an existing input under an existing streaming job. This can be used to partially update (ie. update one or two properties) an input without affecting the rest the job or input definition.
@param input [Input] An Input object. The properties specified here will overwrite the corresponding properties in the existing input (ie. Those properties will be updated). Any properties that are set to null here will mean that the corresponding property in the existing input will remain the same and not change as a result of this PATCH operation. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure
Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param input_name [String] The name of the input. @param if_match [String] The ETag of the input. Omit this value to always overwrite the current input. Specify the last-seen ETag value to prevent accidentally overwritting concurrent changes. @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.
# File lib/2016-03-01/generated/azure_mgmt_stream_analytics/inputs.rb, line 224 def update_with_http_info(input, resource_group_name, job_name, input_name, if_match:nil, custom_headers:nil) update_async(input, resource_group_name, job_name, input_name, if_match:if_match, custom_headers:custom_headers).value! end