diff --git a/management/azure_mgmt_authorization/lib/2015-07-01/build.json b/management/azure_mgmt_authorization/lib/2015-07-01/build.json new file mode 100644 index 0000000000..3c6d7fd8cc --- /dev/null +++ b/management/azure_mgmt_authorization/lib/2015-07-01/build.json @@ -0,0 +1,225 @@ +{ + "autorest": [ + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest-core", + "version": "2.0.4168", + "engines": { + "node": ">=7.10.0" + }, + "dependencies": {}, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/async-io": "~1.0.22", + "@microsoft.azure/extension": "~1.2.12", + "@types/commonmark": "^0.27.0", + "@types/jsonpath": "^0.1.29", + "@types/node": "^8.0.28", + "@types/pify": "0.0.28", + "@types/source-map": "^0.5.0", + "@types/yargs": "^8.0.2", + "commonmark": "^0.27.0", + "file-url": "^2.0.2", + "get-uri": "^2.0.0", + "jsonpath": "^0.2.11", + "linq-es2015": "^2.4.25", + "mocha": "3.4.2", + "mocha-typescript": "1.1.5", + "pify": "^3.0.0", + "safe-eval": "^0.3.0", + "shx": "^0.2.2", + "source-map": "^0.5.6", + "source-map-support": "^0.4.15", + "strip-bom": "^3.0.0", + "typescript": "2.5.3", + "untildify": "^3.0.2", + "urijs": "^1.18.10", + "vscode-jsonrpc": "^3.3.1", + "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", + "yargs": "^8.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "_shasum": "33813111fc9bfa488bd600fbba48bc53cc9182c7", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest-core@2.0.4168", + "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.modeler", + "version": "2.0.21", + "dependencies": { + "dotnet-2.0.0": "^1.3.2" + }, + "optionalDependencies": {}, + "devDependencies": { + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.1.1", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_shasum": "3ce7d3939124b31830be15e5de99b9b7768afb90", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.modeler@2.0.21", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.modeler", + "version": "2.1.22", + "dependencies": { + "dotnet-2.0.0": "^1.4.4" + }, + "optionalDependencies": {}, + "devDependencies": { + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.4.4", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "_shasum": "ca425289fa38a210d279729048a4a91673f09c67", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.modeler@2.1.22", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.ruby", + "version": "3.0.20", + "dependencies": { + "dotnet-2.0.0": "^1.4.4" + }, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/autorest.testserver": "^1.9.2", + "autorest": "^2.0.0", + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.4.4", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "_shasum": "f5b24eb17914aad0e8d2da581642044a6088d905", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.ruby@3.0.20", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "_where": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + } + ], + "autorest_bootstrap": {} +} \ No newline at end of file diff --git a/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/models/role_assignment.rb b/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/models/role_assignment.rb index dc2510f624..0071a5ad5f 100644 --- a/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/models/role_assignment.rb +++ b/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/models/role_assignment.rb @@ -39,6 +39,7 @@ def self.mapper() model_properties: { id: { required: false, + read_only: true, serialized_name: 'id', type: { name: 'String' @@ -46,6 +47,7 @@ def self.mapper() }, name: { required: false, + read_only: true, serialized_name: 'name', type: { name: 'String' @@ -53,6 +55,7 @@ def self.mapper() }, type: { required: false, + read_only: true, serialized_name: 'type', type: { name: 'String' diff --git a/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/models/role_definition.rb b/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/models/role_definition.rb index 1f8d2d0c14..a9edb6af1b 100644 --- a/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/models/role_definition.rb +++ b/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/models/role_definition.rb @@ -39,6 +39,7 @@ def self.mapper() model_properties: { id: { required: false, + read_only: true, serialized_name: 'id', type: { name: 'String' @@ -46,6 +47,7 @@ def self.mapper() }, name: { required: false, + read_only: true, serialized_name: 'name', type: { name: 'String' @@ -53,6 +55,7 @@ def self.mapper() }, type: { required: false, + read_only: true, serialized_name: 'type', type: { name: 'String' diff --git a/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_assignments.rb b/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_assignments.rb index d55b4befec..3d83235849 100644 --- a/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_assignments.rb +++ b/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_assignments.rb @@ -562,7 +562,12 @@ def get_async(scope, role_assignment_name, custom_headers = nil) # # Deletes a role assignment. # - # @param role_assignment_id [String] The ID of the role assignment to delete. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -576,7 +581,12 @@ def delete_by_id(role_assignment_id, custom_headers = nil) # # Deletes a role assignment. # - # @param role_assignment_id [String] The ID of the role assignment to delete. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -589,7 +599,12 @@ def delete_by_id_with_http_info(role_assignment_id, custom_headers = nil) # # Deletes a role assignment. # - # @param role_assignment_id [String] The ID of the role assignment to delete. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # @@ -648,7 +663,12 @@ def delete_by_id_async(role_assignment_id, custom_headers = nil) # # Creates a role assignment by ID. # - # @param role_assignment_id [String] The ID of the role assignment to create. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param parameters [RoleAssignmentCreateParameters] Parameters for the role # assignment. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -664,7 +684,12 @@ def create_by_id(role_assignment_id, parameters, custom_headers = nil) # # Creates a role assignment by ID. # - # @param role_assignment_id [String] The ID of the role assignment to create. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param parameters [RoleAssignmentCreateParameters] Parameters for the role # assignment. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -679,7 +704,12 @@ def create_by_id_with_http_info(role_assignment_id, parameters, custom_headers = # # Creates a role assignment by ID. # - # @param role_assignment_id [String] The ID of the role assignment to create. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param parameters [RoleAssignmentCreateParameters] Parameters for the role # assignment. # @param [Hash{String => String}] A hash of custom headers that will be added @@ -750,7 +780,12 @@ def create_by_id_async(role_assignment_id, parameters, custom_headers = nil) # # Gets a role assignment by ID. # - # @param role_assignment_id [String] The ID of the role assignment to get. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -764,7 +799,12 @@ def get_by_id(role_assignment_id, custom_headers = nil) # # Gets a role assignment by ID. # - # @param role_assignment_id [String] The ID of the role assignment to get. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -777,7 +817,12 @@ def get_by_id_with_http_info(role_assignment_id, custom_headers = nil) # # Gets a role assignment by ID. # - # @param role_assignment_id [String] The ID of the role assignment to get. + # @param role_assignment_id [String] The fully qualified ID of the role + # assignment, including the scope, resource name and resource type. Use the + # format, + # /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + # Example: + # /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # diff --git a/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_definitions.rb b/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_definitions.rb index 9bef264f38..8e771d04cb 100644 --- a/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_definitions.rb +++ b/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_definitions.rb @@ -312,46 +312,49 @@ def create_or_update_async(scope, role_definition_id, role_definition, custom_he end # - # Gets a role definition by ID. + # Get all role definitions that are applicable at scope and above. # - # @param role_definition_id [String] The fully qualified role definition ID to - # get. + # @param scope [String] The scope of the role definition. + # @param filter [String] The filter to apply on the operation. Use + # atScopeAndBelow filter to search below the given scope as well. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [RoleDefinition] operation results. + # @return [Array] operation results. # - def get_by_id(role_definition_id, custom_headers = nil) - response = get_by_id_async(role_definition_id, custom_headers).value! - response.body unless response.nil? + def list(scope, filter = nil, custom_headers = nil) + first_page = list_as_lazy(scope, filter, custom_headers) + first_page.get_all_items end # - # Gets a role definition by ID. + # Get all role definitions that are applicable at scope and above. # - # @param role_definition_id [String] The fully qualified role definition ID to - # get. + # @param scope [String] The scope of the role definition. + # @param filter [String] The filter to apply on the operation. Use + # atScopeAndBelow filter to search below the given scope as well. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_by_id_with_http_info(role_definition_id, custom_headers = nil) - get_by_id_async(role_definition_id, custom_headers).value! + def list_with_http_info(scope, filter = nil, custom_headers = nil) + list_async(scope, filter, custom_headers).value! end # - # Gets a role definition by ID. + # Get all role definitions that are applicable at scope and above. # - # @param role_definition_id [String] The fully qualified role definition ID to - # get. + # @param scope [String] The scope of the role definition. + # @param filter [String] The filter to apply on the operation. Use + # atScopeAndBelow filter to search below the given scope as well. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_by_id_async(role_definition_id, custom_headers = nil) - fail ArgumentError, 'role_definition_id is nil' if role_definition_id.nil? + def list_async(scope, filter = nil, custom_headers = nil) + fail ArgumentError, 'scope is nil' if scope.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -360,14 +363,14 @@ def get_by_id_async(role_definition_id, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '{roleDefinitionId}' + path_template = '{scope}/providers/Microsoft.Authorization/roleDefinitions' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - skip_encoding_path_params: {'roleDefinitionId' => role_definition_id}, - query_params: {'api-version' => @client.api_version}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'$filter' => filter,'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } @@ -387,7 +390,7 @@ def get_by_id_async(role_definition_id, custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::Authorization::Mgmt::V2015_07_01::Models::RoleDefinition.mapper() + result_mapper = Azure::Authorization::Mgmt::V2015_07_01::Models::RoleDefinitionListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -401,49 +404,58 @@ def get_by_id_async(role_definition_id, custom_headers = nil) end # - # Get all role definitions that are applicable at scope and above. + # Gets a role definition by ID. # - # @param scope [String] The scope of the role definition. - # @param filter [String] The filter to apply on the operation. Use - # atScopeAndBelow filter to search below the given scope as well. + # @param role_definition_id [String] The fully qualified role definition ID. + # Use the format, + # /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + # for subscription level role definitions, or + # /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for + # tenant level role definitions. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [Array] operation results. + # @return [RoleDefinition] operation results. # - def list(scope, filter = nil, custom_headers = nil) - first_page = list_as_lazy(scope, filter, custom_headers) - first_page.get_all_items + def get_by_id(role_definition_id, custom_headers = nil) + response = get_by_id_async(role_definition_id, custom_headers).value! + response.body unless response.nil? end # - # Get all role definitions that are applicable at scope and above. + # Gets a role definition by ID. # - # @param scope [String] The scope of the role definition. - # @param filter [String] The filter to apply on the operation. Use - # atScopeAndBelow filter to search below the given scope as well. + # @param role_definition_id [String] The fully qualified role definition ID. + # Use the format, + # /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + # for subscription level role definitions, or + # /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for + # tenant level role definitions. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_with_http_info(scope, filter = nil, custom_headers = nil) - list_async(scope, filter, custom_headers).value! + def get_by_id_with_http_info(role_definition_id, custom_headers = nil) + get_by_id_async(role_definition_id, custom_headers).value! end # - # Get all role definitions that are applicable at scope and above. + # Gets a role definition by ID. # - # @param scope [String] The scope of the role definition. - # @param filter [String] The filter to apply on the operation. Use - # atScopeAndBelow filter to search below the given scope as well. + # @param role_definition_id [String] The fully qualified role definition ID. + # Use the format, + # /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + # for subscription level role definitions, or + # /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for + # tenant level role definitions. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_async(scope, filter = nil, custom_headers = nil) - fail ArgumentError, 'scope is nil' if scope.nil? + def get_by_id_async(role_definition_id, custom_headers = nil) + fail ArgumentError, 'role_definition_id is nil' if role_definition_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? @@ -452,14 +464,14 @@ def list_async(scope, filter = nil, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '{scope}/providers/Microsoft.Authorization/roleDefinitions' + path_template = '{roleDefinitionId}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - skip_encoding_path_params: {'scope' => scope}, - query_params: {'$filter' => filter,'api-version' => @client.api_version}, + skip_encoding_path_params: {'roleDefinitionId' => role_definition_id}, + query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } @@ -479,7 +491,7 @@ def list_async(scope, filter = nil, custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::Authorization::Mgmt::V2015_07_01::Models::RoleDefinitionListResult.mapper() + result_mapper = Azure::Authorization::Mgmt::V2015_07_01::Models::RoleDefinition.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)