Open pvasilevich opened 7 years ago
@sergey-shandar , that seems to be a bug in the AutoRest PHP generator which should treat RecordType as a simple type
@yaqiyang Thanks for the hint, I will have a look.
I have manually removed "array" from functions declaration and checked how it will work for simple string argument. I've faced another issue:
Code: 400
Value: Bad Request
details (if any): {"code":"BadRequest","message":"The domain name '{relativerecordsetname}.domain.example.com' is invalid. The provided record set relative name '{relativerecordsetname}' is invalid."}.
What I see in code is: \Arm\Dns\RecordSets.php
$path = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}';
...
$path = strtr($path, ['{resourceGroupName}' => $resourceGroupName, '{zoneName}' => $zoneName, '{recordType}' => $recordType, '{subscriptionId}' => $this->_client->getSubscriptionId()]);
there is no replacement for {relativeRecordSetName} placeholder. Should I post another issue for that?
Should I post another issue for that?
It's not required but it's up to you.
The methods still take array $recordType
where is should be a string
, and '{relativeRecordSetName}' => $relativeRecordSetName
is missing in the replacement. Is there any work being done to the arm
branch?
Can anyone give an example of the $parameters
for creating a A-Record? I have tried different variations, but no TTL or ip-address is set. Record is created without the values.
// Test 1
'TTL' => 3600,
'ARecords' => '123.123.123.123'
// Test 2
'ttl' => 3600,
'ARecords' => ['123.123.123.123']
// Test 3
'Ttl' => 3600,
'ARecords' => [
'Ipv4Address' => '123.123.123.123'
]
// Test 4
'Ttl' => 3600,
'ARecords' => [
['Ipv4Address' => '123.123.123.123']
]
Thanks!
Edit: I have tried the arm2
branch with the same result.
I'm using preview ARM API.
in API you have method:
in class
MicrosoftAzure\Arm\Dns\RecordSets
. This method requires that$recordType
is an array. This method calls another methodThis method also declares that
$recordType
is an array.inside this function we can see:
When I'm trying to use ['NS'] as $recordType argument, then it will be converted to ".../Array/..." and PHP Notice: Array to string conversion is generated. Trying to pass any other object as argument brings an error: PHP : Argument 4 passed to MicrosoftAzure\Arm\Dns\RecordSets::createOrUpdate() must be of the type array, object given ...
in docblock for these functions there is class RecordType.
But in fact there is no such class declared.