You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
I am using the gem azure_mgmt_recovery_services to create a vault. L131 mentions that a Azure::ARM::RecoveryServices::Models::Vault object is also required to be passed to the create_or_update operation. So I created a Vault object and passed it to the create_or_update call. My script is the following
However, running this script results in the following error
/var/lib/gems/2.3.0/gems/azure_mgmt_recovery_services-0.8.0/lib/generated/azure_mgmt_recovery_services/vaults.rb:205:in `block in create_or_update_async': { (MsRestAzure::AzureOperationError)
"message": "MsRestAzure::AzureOperationError: InvalidRestApiParameter: properties parameter is invalid.\r\nPlease provide a valid properties",
"request": {
"base_uri": "https://management.azure.com",
"path_template": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}",
"method": "put",
"path_params": {
"subscriptionId": "67f2116d-4ea2-4c6c-b20a-f92183dbe3cb",
"resourceGroupName": "TestRG-RV",
"vaultName": "TestVault"
},
"skip_encoding_path_params": null,
"query_params": {
"api-version": "2016-06-01"
},
"skip_encoding_query_params": null,
"headers": {
"Content-Type": "application/json; charset=utf-8",
"accept-language": "en-US",
"x-ms-client-request-id": "b6f19c31-958a-4def-b37f-3064b00bb2c8"
},
"body": "{\"location\":\"eastus\",\"properties\":{}}",
"middlewares": [
[
"MsRest::RetryPolicyMiddleware",
{
"times": 3,
"retry": 0.02
}
],
[
"cookie_jar"
]
],
"log": null
},
"response": {
"body": "{\"error\":{\"code\":\"InvalidRestApiParameter\",\"message\":\"properties parameter is invalid.\\r\\nPlease provide a valid properties\",\"target\":null,\"details\":null,\"innerError\":null}}",
"headers": {
"cache-control": "no-cache",
"pragma": "no-cache",
"content-length": "173",
"content-type": "application/json",
"expires": "-1",
"x-ms-request-id": "6b061cfd-697e-438b-8f9e-7816b1c772c7",
"x-ms-client-request-id": "b6f19c31-958a-4def-b37f-3064b00bb2c8",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"server": "Microsoft-IIS/8.0",
"x-ms-ratelimit-remaining-subscription-writes": "1196",
"x-ms-correlation-request-id": "6b061cfd-697e-438b-8f9e-7816b1c772c7",
"x-ms-routing-request-id": "SOUTHEASTASIA:20170111T112859Z:6b061cfd-697e-438b-8f9e-7816b1c772c7",
"date": "Wed, 11 Jan 2017 11:28:59 GMT",
"connection": "close"
},
"status": 400
}
}
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/promise.rb:501:in `block in on_fulfill'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `block in synchronize'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/promise.rb:531:in `block in realize'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.4/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
Process finished with exit code 1
Upon further inspection, I found out that we also need to pass a Sku object to the Vault object as an attribute. However, the model for Vault does not specify any such attribute. This attribute is present when we retrieve a Vault object via the get request. This attribute needs to be set using the instance_variable_set method. Using this method and updating my script to the one below the issue was fixed and the vault was created.
Kindly update your Azure::ARM::RecoveryServices::Models::Vault to include Sku as an attribute since it is required to create a RecoveryServices::Vault object.
Thanks
The text was updated successfully, but these errors were encountered:
bilal-naeem-confiz
changed the title
Azure Recovery Services Vaults
Azure Recovery Services Vaults Sku Attribute
Jan 11, 2017
Hi @vishrutshah
I am using the gem
azure_mgmt_recovery_services
to create a vault. L131 mentions that aAzure::ARM::RecoveryServices::Models::Vault
object is also required to be passed to thecreate_or_update
operation. So I created aVault
object and passed it to thecreate_or_update
call. My script is the followingHowever, running this script results in the following error
Upon further inspection, I found out that we also need to pass a
Sku
object to theVault
object as an attribute. However, the model forVault
does not specify any such attribute. This attribute is present when we retrieve aVault
object via theget
request. This attribute needs to be set using theinstance_variable_set
method. Using this method and updating my script to the one below the issue was fixed and the vault was created.Kindly update your
Azure::ARM::RecoveryServices::Models::Vault
to includeSku
as an attribute since it is required to create aRecoveryServices::Vault
object.Thanks
The text was updated successfully, but these errors were encountered: