Class: Azure::Resources::Mgmt::V2019_10_01::Resources
- Inherits:
-
Object
- Object
- Azure::Resources::Mgmt::V2019_10_01::Resources
- Includes:
- MsRestAzure
- Defined in:
- lib/2019-10-01/generated/azure_mgmt_resources/resources.rb
Overview
Provides operations for working with resources and resource groups.
Instance Attribute Summary collapse
-
#client ⇒ ResourceManagementClient
readonly
Reference to the ResourceManagementClient.
Instance Method Summary collapse
-
#begin_create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Creates a resource.
-
#begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Creates a resource.
-
#begin_create_or_update_by_id(resource_id, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Create a resource by ID.
-
#begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Create a resource by ID.
-
#begin_create_or_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create a resource by ID.
-
#begin_create_or_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a resource.
-
#begin_delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Object
Deletes a resource.
-
#begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a resource.
-
#begin_delete_by_id(resource_id, api_version, custom_headers: nil) ⇒ Object
Deletes a resource by ID.
-
#begin_delete_by_id_async(resource_id, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a resource by ID.
-
#begin_delete_by_id_with_http_info(resource_id, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a resource by ID.
-
#begin_delete_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a resource.
-
#begin_move_resources(source_resource_group_name, parameters, custom_headers: nil) ⇒ Object
Moves resources from one resource group to another resource group.
-
#begin_move_resources_async(source_resource_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Moves resources from one resource group to another resource group.
-
#begin_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Moves resources from one resource group to another resource group.
-
#begin_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Updates a resource.
-
#begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Updates a resource.
-
#begin_update_by_id(resource_id, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Updates a resource by ID.
-
#begin_update_by_id_async(resource_id, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Updates a resource by ID.
-
#begin_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates a resource by ID.
-
#begin_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates a resource.
-
#begin_validate_move_resources(source_resource_group_name, parameters, custom_headers: nil) ⇒ Object
Validates whether resources can be moved from one resource group to another resource group.
-
#begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Validates whether resources can be moved from one resource group to another resource group.
-
#begin_validate_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Validates whether resources can be moved from one resource group to another resource group.
-
#check_existence(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Boolean
Checks whether a resource exists.
-
#check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Checks whether a resource exists.
-
#check_existence_by_id(resource_id, api_version, custom_headers: nil) ⇒ Boolean
Checks by ID whether a resource exists.
-
#check_existence_by_id_async(resource_id, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Checks by ID whether a resource exists.
-
#check_existence_by_id_with_http_info(resource_id, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Checks by ID whether a resource exists.
-
#check_existence_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Checks whether a resource exists.
-
#create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Creates a resource.
-
#create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
resource.
-
#create_or_update_by_id(resource_id, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Create a resource by ID.
-
#create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
the resource name and resource type.
-
#delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Object
Deletes a resource.
-
#delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise
contains the resource to delete.
-
#delete_by_id(resource_id, api_version, custom_headers: nil) ⇒ Object
Deletes a resource by ID.
-
#delete_by_id_async(resource_id, api_version, custom_headers: nil) ⇒ Concurrent::Promise
the resource name and resource type.
-
#get(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ GenericResource
Gets a resource.
-
#get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Gets a resource.
-
#get_by_id(resource_id, api_version, custom_headers: nil) ⇒ GenericResource
Gets a resource by ID.
-
#get_by_id_async(resource_id, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Gets a resource by ID.
-
#get_by_id_with_http_info(resource_id, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a resource by ID.
-
#get_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a resource.
-
#initialize(client) ⇒ Resources
constructor
Creates and initializes a new instance of the Resources class.
-
#list(filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ Array<GenericResourceExpanded>
Get all the resources in a subscription.
-
#list_as_lazy(filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ ResourceListResult
Get all the resources in a subscription.
-
#list_async(filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get all the resources in a subscription.
-
#list_by_resource_group(resource_group_name, filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ Array<GenericResourceExpanded>
Get all the resources for a resource group.
-
#list_by_resource_group_as_lazy(resource_group_name, filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ ResourceListResult
Get all the resources for a resource group.
-
#list_by_resource_group_async(resource_group_name, filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get all the resources for a resource group.
-
#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ ResourceListResult
Get all the resources for a resource group.
-
#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Get all the resources for a resource group.
-
#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all the resources for a resource group.
-
#list_by_resource_group_with_http_info(resource_group_name, filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all the resources for a resource group.
-
#list_next(next_page_link, custom_headers: nil) ⇒ ResourceListResult
Get all the resources in a subscription.
-
#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Get all the resources in a subscription.
-
#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all the resources in a subscription.
-
#list_with_http_info(filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all the resources in a subscription.
-
#move_resources(source_resource_group_name, parameters, custom_headers: nil) ⇒ Object
Moves resources from one resource group to another resource group.
-
#move_resources_async(source_resource_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
containing the resources to move.
-
#update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Updates a resource.
-
#update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
resource.
-
#update_by_id(resource_id, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Updates a resource by ID.
-
#update_by_id_async(resource_id, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
the resource name and resource type.
-
#validate_move_resources(source_resource_group_name, parameters, custom_headers: nil) ⇒ Object
Validates whether resources can be moved from one resource group to another resource group.
-
#validate_move_resources_async(source_resource_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
containing the resources to validate for move.
Constructor Details
#initialize(client) ⇒ Resources
Creates and initializes a new instance of the Resources class.
17 18 19 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ ResourceManagementClient (readonly)
Returns reference to the ResourceManagementClient.
22 23 24 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 22 def client @client end |
Instance Method Details
#begin_create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Creates a resource.
resource. The name is case insensitive. provider. resource. will be added to the HTTP request.
1517 1518 1519 1520 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1517 def begin_create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Creates a resource.
resource. The name is case insensitive. provider. resource. to the HTTP request.
1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1562 def begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil? fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil? fail ArgumentError, 'resource_type is nil' if resource_type.nil? fail ArgumentError, 'resource_name is nil' if resource_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id}, skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:put, path_template, ) 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 || 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., 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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_create_or_update_by_id(resource_id, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Create a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
1872 1873 1874 1875 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1872 def begin_create_or_update_by_id(resource_id, api_version, parameters, custom_headers:nil) response = begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Create a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name to the HTTP request.
1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1907 def begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:nil) fail ArgumentError, 'resource_id is nil' if resource_id.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'parameters is nil' if parameters.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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = '{resourceId}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'resourceId' => resource_id}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:put, path_template, ) 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 || 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., 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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_create_or_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
1890 1891 1892 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1890 def begin_create_or_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers:nil) begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value! end |
#begin_create_or_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a resource.
resource. The name is case insensitive. provider. resource. will be added to the HTTP request.
1540 1541 1542 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1540 def begin_create_or_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value! end |
#begin_delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Object
Deletes a resource.
contains the resource to delete. The name is case insensitive. provider. will be added to the HTTP request.
1406 1407 1408 1409 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1406 def begin_delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) response = begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value! nil end |
#begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a resource.
contains the resource to delete. The name is case insensitive. provider. to the HTTP request.
1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1447 def begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil? fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil? fail ArgumentError, 'resource_type is nil' if resource_type.nil? fail ArgumentError, 'resource_name is nil' if resource_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id}, skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, ) 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 || 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_delete_by_id(resource_id, api_version, custom_headers: nil) ⇒ Object
Deletes a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
1783 1784 1785 1786 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1783 def begin_delete_by_id(resource_id, api_version, custom_headers:nil) response = begin_delete_by_id_async(resource_id, api_version, custom_headers:custom_headers).value! nil end |
#begin_delete_by_id_async(resource_id, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name to the HTTP request.
1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1816 def begin_delete_by_id_async(resource_id, api_version, custom_headers:nil) fail ArgumentError, 'resource_id is nil' if resource_id.nil? fail ArgumentError, 'api_version is nil' if api_version.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 = '{resourceId}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'resourceId' => resource_id}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, ) 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 || 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_delete_by_id_with_http_info(resource_id, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
1800 1801 1802 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1800 def begin_delete_by_id_with_http_info(resource_id, api_version, custom_headers:nil) begin_delete_by_id_async(resource_id, api_version, custom_headers:custom_headers).value! end |
#begin_delete_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a resource.
contains the resource to delete. The name is case insensitive. provider. will be added to the HTTP request.
1427 1428 1429 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1427 def begin_delete_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value! end |
#begin_move_resources(source_resource_group_name, parameters, custom_headers: nil) ⇒ Object
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
containing the resources to move. will be added to the HTTP request.
1170 1171 1172 1173 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1170 def begin_move_resources(source_resource_group_name, parameters, custom_headers:nil) response = begin_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value! nil end |
#begin_move_resources_async(source_resource_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
containing the resources to move. to the HTTP request.
1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1213 def begin_move_resources_async(source_resource_group_name, parameters, custom_headers:nil) fail ArgumentError, 'source_resource_group_name is nil' if source_resource_group_name.nil? fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !source_resource_group_name.nil? && source_resource_group_name.length > 90 fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !source_resource_group_name.nil? && source_resource_group_name.length < 1 fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !source_resource_group_name.nil? && source_resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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 = {} 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::Resources::Mgmt::V2019_10_01::Models::ResourcesMoveInfo.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'sourceResourceGroupName' => source_resource_group_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(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 || 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
containing the resources to move. will be added to the HTTP request.
1192 1193 1194 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1192 def begin_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers:nil) begin_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value! end |
#begin_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Updates a resource.
resource. The name is case insensitive. provider. will be added to the HTTP request.
1659 1660 1661 1662 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1659 def begin_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) response = begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Updates a resource.
resource. The name is case insensitive. provider. to the HTTP request.
1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1702 def begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil? fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil? fail ArgumentError, 'resource_type is nil' if resource_type.nil? fail ArgumentError, 'resource_name is nil' if resource_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id}, skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:patch, path_template, ) 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_update_by_id(resource_id, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Updates a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
1991 1992 1993 1994 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1991 def begin_update_by_id(resource_id, api_version, parameters, custom_headers:nil) response = begin_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_update_by_id_async(resource_id, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Updates a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name to the HTTP request.
2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2026 def begin_update_by_id_async(resource_id, api_version, parameters, custom_headers:nil) fail ArgumentError, 'resource_id is nil' if resource_id.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'parameters is nil' if parameters.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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = '{resourceId}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'resourceId' => resource_id}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:patch, path_template, ) 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
2009 2010 2011 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2009 def begin_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers:nil) begin_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value! end |
#begin_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates a resource.
resource. The name is case insensitive. provider. will be added to the HTTP request.
1681 1682 1683 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1681 def begin_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value! end |
#begin_validate_move_resources(source_resource_group_name, parameters, custom_headers: nil) ⇒ Object
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
containing the resources to validate for move. will be added to the HTTP request.
1287 1288 1289 1290 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1287 def begin_validate_move_resources(source_resource_group_name, parameters, custom_headers:nil) response = begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value! nil end |
#begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
containing the resources to validate for move. to the HTTP request.
1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1336 def begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers:nil) fail ArgumentError, 'source_resource_group_name is nil' if source_resource_group_name.nil? fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !source_resource_group_name.nil? && source_resource_group_name.length > 90 fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !source_resource_group_name.nil? && source_resource_group_name.length < 1 fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !source_resource_group_name.nil? && source_resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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 = {} 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::Resources::Mgmt::V2019_10_01::Models::ResourcesMoveInfo.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'sourceResourceGroupName' => source_resource_group_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(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 || 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_validate_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
containing the resources to validate for move. will be added to the HTTP request.
1312 1313 1314 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1312 def begin_validate_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers:nil) begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value! end |
#check_existence(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Boolean
Checks whether a resource exists.
the resource to check. The name is case insensitive. resource to check. exists. will be added to the HTTP request.
450 451 452 453 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 450 def check_existence(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) response = check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value! response.body unless response.nil? end |
#check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Checks whether a resource exists.
the resource to check. The name is case insensitive. resource to check. exists. to the HTTP request.
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 493 def check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil? fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil? fail ArgumentError, 'resource_type is nil' if resource_type.nil? fail ArgumentError, 'resource_name is nil' if resource_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id}, skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:head, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 204 || status_code == 404 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.body = (status_code == 204) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#check_existence_by_id(resource_id, api_version, custom_headers: nil) ⇒ Boolean
Checks by ID whether a resource exists.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
841 842 843 844 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 841 def check_existence_by_id(resource_id, api_version, custom_headers:nil) response = check_existence_by_id_async(resource_id, api_version, custom_headers:custom_headers).value! response.body unless response.nil? end |
#check_existence_by_id_async(resource_id, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Checks by ID whether a resource exists.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name to the HTTP request.
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 874 def check_existence_by_id_async(resource_id, api_version, custom_headers:nil) fail ArgumentError, 'resource_id is nil' if resource_id.nil? fail ArgumentError, 'api_version is nil' if api_version.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 = '{resourceId}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'resourceId' => resource_id}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:head, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 204 || status_code == 404 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.body = (status_code == 204) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#check_existence_by_id_with_http_info(resource_id, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Checks by ID whether a resource exists.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
858 859 860 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 858 def check_existence_by_id_with_http_info(resource_id, api_version, custom_headers:nil) check_existence_by_id_async(resource_id, api_version, custom_headers:custom_headers).value! end |
#check_existence_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Checks whether a resource exists.
the resource to check. The name is case insensitive. resource to check. exists. will be added to the HTTP request.
472 473 474 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 472 def check_existence_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value! end |
#create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Creates a resource.
resource. The name is case insensitive. provider. resource. will be added to the HTTP request.
614 615 616 617 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 614 def create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
resource. The name is case insensitive. provider. resource. will be added to the HTTP request.
response.
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 636 def create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) # Send request promise = begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::GenericResource.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 |
#create_or_update_by_id(resource_id, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Create a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
973 974 975 976 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 973 def create_or_update_by_id(resource_id, api_version, parameters, custom_headers:nil) response = create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
response.
990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 990 def create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:nil) # Send request promise = begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::GenericResource.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 |
#delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Object
Deletes a resource.
contains the resource to delete. The name is case insensitive. provider. will be added to the HTTP request.
560 561 562 563 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 560 def delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) response = delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value! nil end |
#delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise
contains the resource to delete. The name is case insensitive. provider. will be added to the HTTP request.
response.
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 580 def delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#delete_by_id(resource_id, api_version, custom_headers: nil) ⇒ Object
Deletes a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
928 929 930 931 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 928 def delete_by_id(resource_id, api_version, custom_headers:nil) response = delete_by_id_async(resource_id, api_version, custom_headers:custom_headers).value! nil end |
#delete_by_id_async(resource_id, api_version, custom_headers: nil) ⇒ Concurrent::Promise
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
response.
944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 944 def delete_by_id_async(resource_id, api_version, custom_headers:nil) # Send request promise = begin_delete_by_id_async(resource_id, api_version, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#get(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ GenericResource
Gets a resource.
the resource to get. The name is case insensitive. provider. will be added to the HTTP request.
726 727 728 729 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 726 def get(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) response = get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Gets a resource.
the resource to get. The name is case insensitive. provider. to the HTTP request.
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 767 def get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil? fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil? fail ArgumentError, 'resource_type is nil' if resource_type.nil? fail ArgumentError, 'resource_name is nil' if resource_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id}, skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_by_id(resource_id, api_version, custom_headers: nil) ⇒ GenericResource
Gets a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
1068 1069 1070 1071 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1068 def get_by_id(resource_id, api_version, custom_headers:nil) response = get_by_id_async(resource_id, api_version, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_by_id_async(resource_id, api_version, custom_headers: nil) ⇒ Concurrent::Promise
Gets a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name to the HTTP request.
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1101 def get_by_id_async(resource_id, api_version, custom_headers:nil) fail ArgumentError, 'resource_id is nil' if resource_id.nil? fail ArgumentError, 'api_version is nil' if api_version.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 = '{resourceId}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'resourceId' => resource_id}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::GenericResource.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_by_id_with_http_info(resource_id, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
1085 1086 1087 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1085 def get_by_id_with_http_info(resource_id, api_version, custom_headers:nil) get_by_id_async(resource_id, api_version, custom_headers:custom_headers).value! end |
#get_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a resource.
the resource to get. The name is case insensitive. provider. will be added to the HTTP request.
747 748 749 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 747 def get_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil) get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value! end |
#list(filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ Array<GenericResourceExpanded>
Get all the resources in a subscription.
properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or operators.
You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.
You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. returns all resource groups. will be added to the HTTP request.
311 312 313 314 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 311 def list(filter:nil, expand:nil, top:nil, custom_headers:nil) first_page = list_as_lazy(filter:filter, expand:, top:top, custom_headers:custom_headers) first_page.get_all_items end |
#list_as_lazy(filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ ResourceListResult
Get all the resources in a subscription.
properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or operators.
You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.
You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. returns all resource groups. will be added to the HTTP request.
response.
2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2342 def list_as_lazy(filter:nil, expand:nil, top:nil, custom_headers:nil) response = list_async(filter:filter, expand:, top:top, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_async(filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get all the resources in a subscription.
properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or operators.
You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.
You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. returns all resource groups. to the HTTP request.
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 380 def list_async(filter:nil, expand:nil, top: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? 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}/resources' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id}, query_params: {'$filter' => filter,'$expand' => ,'$top' => top,'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::ResourceListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_resource_group(resource_group_name, filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ Array<GenericResourceExpanded>
Get all the resources for a resource group.
get. properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or operators.
You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.
You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. returns all resources. will be added to the HTTP request.
56 57 58 59 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 56 def list_by_resource_group(resource_group_name, filter:nil, expand:nil, top:nil, custom_headers:nil) first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, expand:, top:top, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_resource_group_as_lazy(resource_group_name, filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ ResourceListResult
Get all the resources for a resource group.
get. properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or operators.
You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.
You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. returns all resources. will be added to the HTTP request.
response.
2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2300 def list_by_resource_group_as_lazy(resource_group_name, filter:nil, expand:nil, top:nil, custom_headers:nil) response = list_by_resource_group_async(resource_group_name, filter:filter, expand:, top:top, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_resource_group_async(resource_group_name, filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get all the resources for a resource group.
get. properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or operators.
You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.
You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. returns all resources. to the HTTP request.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 129 def list_by_resource_group_async(resource_group_name, filter:nil, expand:nil, top:nil, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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 = {} 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}/resources' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id}, query_params: {'$filter' => filter,'$expand' => ,'$top' => top,'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::ResourceListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ ResourceListResult
Get all the resources for a resource group.
to List operation. will be added to the HTTP request.
2097 2098 2099 2100 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2097 def list_by_resource_group_next(next_page_link, custom_headers:nil) response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Get all the resources for a resource group.
to List operation. to the HTTP request.
2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2126 def list_by_resource_group_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 = { 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, ) 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::ResourceListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all the resources for a resource group.
to List operation. will be added to the HTTP request.
2112 2113 2114 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2112 def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_resource_group_with_http_info(resource_group_name, filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all the resources for a resource group.
get. properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or operators.
You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.
You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. returns all resources. will be added to the HTTP request.
93 94 95 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 93 def list_by_resource_group_with_http_info(resource_group_name, filter:nil, expand:nil, top:nil, custom_headers:nil) list_by_resource_group_async(resource_group_name, filter:filter, expand:, top:top, custom_headers:custom_headers).value! end |
#list_next(next_page_link, custom_headers: nil) ⇒ ResourceListResult
Get all the resources in a subscription.
to List operation. will be added to the HTTP request.
2187 2188 2189 2190 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2187 def list_next(next_page_link, custom_headers:nil) response = list_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Get all the resources in a subscription.
to List operation. to the HTTP request.
2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2216 def list_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 = { 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, ) 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Resources::Mgmt::V2019_10_01::Models::ResourceListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all the resources in a subscription.
to List operation. will be added to the HTTP request.
2202 2203 2204 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 2202 def list_next_with_http_info(next_page_link, custom_headers:nil) list_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_with_http_info(filter: nil, expand: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all the resources in a subscription.
properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or operators.
You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.
You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. returns all resource groups. will be added to the HTTP request.
346 347 348 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 346 def list_with_http_info(filter:nil, expand:nil, top:nil, custom_headers:nil) list_async(filter:filter, expand:, top:top, custom_headers:custom_headers).value! end |
#move_resources(source_resource_group_name, parameters, custom_headers: nil) ⇒ Object
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
containing the resources to move. will be added to the HTTP request.
201 202 203 204 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 201 def move_resources(source_resource_group_name, parameters, custom_headers:nil) response = move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value! nil end |
#move_resources_async(source_resource_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
containing the resources to move. will be added to the HTTP request.
response.
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 216 def move_resources_async(source_resource_group_name, parameters, custom_headers:nil) # Send request promise = begin_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Updates a resource.
resource. The name is case insensitive. provider. will be added to the HTTP request.
671 672 673 674 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 671 def update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) response = update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
resource. The name is case insensitive. provider. will be added to the HTTP request.
response.
692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 692 def update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) # Send request promise = begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::GenericResource.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 |
#update_by_id(resource_id, api_version, parameters, custom_headers: nil) ⇒ GenericResource
Updates a resource by ID.
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
1021 1022 1023 1024 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1021 def update_by_id(resource_id, api_version, parameters, custom_headers:nil) response = update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#update_by_id_async(resource_id, api_version, parameters, custom_headers: nil) ⇒ Concurrent::Promise
the resource name and resource type. Use the format, /subscriptions/guid/resourceGroups/resource-group-name/resource-provider-namespace/resource-type/resource-name will be added to the HTTP request.
response.
1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 1038 def update_by_id_async(resource_id, api_version, parameters, custom_headers:nil) # Send request promise = begin_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::GenericResource.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 |
#validate_move_resources(source_resource_group_name, parameters, custom_headers: nil) ⇒ Object
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
containing the resources to validate for move. will be added to the HTTP request.
250 251 252 253 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 250 def validate_move_resources(source_resource_group_name, parameters, custom_headers:nil) response = validate_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value! nil end |
#validate_move_resources_async(source_resource_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
containing the resources to validate for move. will be added to the HTTP request.
response.
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/2019-10-01/generated/azure_mgmt_resources/resources.rb', line 265 def validate_move_resources_async(source_resource_group_name, parameters, custom_headers:nil) # Send request promise = begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |