-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Automation] Adding new API spec for 2018-01-15 version #2690
[Automation] Adding new API spec for 2018-01-15 version #2690
Conversation
Automation for azure-sdk-for-nodeA PR has been created for you: |
Automation for azure-libraries-for-javaNothing to generate for azure-libraries-for-java |
Automation for azure-sdk-for-pythonA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
Automation for azure-sdk-for-goEncountered a Subprocess error: (azure-sdk-for-go)
Command: ['/usr/local/bin/autorest', '/tmp/tmple9pthre/rest/specification/automation/resource-manager/readme.md', '--go', '--go-sdk-folder=/tmp/tmple9pthre/sdk', '--multiapi', '[email protected]/autorest.go@~2.1.95', '--use-onever', '--verbose'] AutoRest code generation utility [version: 2.0.4259; node: v7.10.1]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Loading AutoRest core '/tmp/.autorest/@[email protected]/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4259)
Loading AutoRest extension '@microsoft.azure/autorest.go' (~2.1.95->2.1.95)
Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.38->2.3.38)
Processing batch task - {"tag":"package-2015-10"} .
Processing batch task - {"tag":"package-2017-05-preview"} .
Processing batch task - {"tag":"package-2018-01-preview"} .
FATAL: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.String.LastIndexOf(Char value, Int32 startIndex, Int32 count)
at AutoRest.Go.Model.CodeModelGo.PackageVerDir() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISH2qmje\111_20180319T191725\autorest.go\src\Model\CodeModelGo.cs:line 64
at AutoRest.Go.Model.CodeModelGo.get_DefaultUserAgent() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISH2qmje\111_20180319T191725\autorest.go\src\Model\CodeModelGo.cs:line 83
at AutoRest.Go.Model.CodeModelGo.get_UserAgent() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISH2qmje\111_20180319T191725\autorest.go\src\Model\CodeModelGo.cs:line 31
at AutoRest.Go.Templates.VersionTemplate.<ExecuteAsync>d__1.MoveNext() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISH2qmje\111_20180319T191725\autorest.go\src\obj\Razor\Templates\VersionTemplate.cshtml:line 28
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Core.CodeGenerator.<Write>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Go.CodeGeneratorGo.<Generate>d__6.MoveNext() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISH2qmje\111_20180319T191725\autorest.go\src\CodeGeneratorGo.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Go.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISH2qmje\111_20180319T191725\autorest.go\src\Program.cs:line 107
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NewPlugin.<Process>d__15.MoveNext()
FATAL: go/generate - FAILED
FATAL: Error: Plugin go reported failure.
Process() cancelled due to exception : Plugin go reported failure.
Failure during batch task - {"tag":"package-2018-01-preview"} -- Error: Plugin go reported failure..
Error: Plugin go reported failure. |
Depends on #2705. The refactoring is needed to go in, to fix the linting issue entirely. |
@@ -92,10 +89,43 @@ input-file: | |||
- Microsoft.Automation/preview/2017-05-15-preview/job.json | |||
``` | |||
|
|||
### Tag: package-2018-01 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package-2018-01 [](start = 9, length = 15)
Since this package also has files from preview versions, it should also be marked as a preview package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
}, | ||
"day": { | ||
"type": "string", | ||
"description": "Day of the occurrence. Must be one of monday, tuesday, wednesday,thursday, friday, saturday, sunday.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thursday [](start = 91, length = 8)
Super nit, space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
}, | ||
"AdvancedSchedule": { | ||
"properties": { | ||
"weekDays": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weekDays [](start = 9, length = 8)
Are the possible values the same as in line 44?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Jobs resource will be fixed in a separate PR as I don't have much knowledge of it. I just moved the definitions form 2015-10-31/definitions.json to prevent conflict that I was seeing earlier. Thus, right now, could we keep the spec for 2017-05-15-preview/definitions.json as it is? I'll take up the task of correcting it with the engineer who worked on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okok
"description": "The provisioning state of a resource." | ||
} | ||
}, | ||
"description": "Definition of job properties." | ||
}, | ||
"jobCollectionItem": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jobCollectionItem [](start = 5, length = 17)
Should this be PascalCase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
"format": "double", | ||
"description": "Gets or sets the next run time's offset in minutes." | ||
}, | ||
"interval": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interval [](start = 9, length = 8)
What type is this property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking with the JobService team. This will go in a separate JobService PR. (mentioned above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"JobCreateProperties": { | ||
"properties": { | ||
"runbook": { | ||
"$ref": "./definitions.json#/definitions/RunbookAssociationProperty", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./definitions.json [](start = 19, length = 18)
This is already the definiitions file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"type": "string", | ||
"required": true, | ||
"in": "path", | ||
"x-ms-parameter-location": "client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client [](start = 34, length = 6)
This goes better in the method instead of the client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"type": "string", | ||
"required": true, | ||
"in": "path", | ||
"x-ms-parameter-location": "client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client [](start = 34, length = 6)
This goes better in the method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err, it should be "x-ms-parameter-location": "method"
In reply to: 175917693 [](ancestors = 175917693)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"tags": [ | ||
"DscCompilationJob" | ||
], | ||
"operationId": "DscCompilationJob_Create", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DscCompilationJob_Create [](start = 24, length = 24)
Is this a long running operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this is not. It just submits a job and returns the JobId, which is then used to track the progress of the Job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should clients then poll for operation completion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a long running operation to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading this up, it makes sense to mark this as x-ms-long-running-operation
. I will do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"readOnly": true, | ||
"description": "Gets the creation time of the job." | ||
}, | ||
"provisioningState": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provisioningState [](start = 9, length = 17)
Does the service really have a provisiningState property inside another provisioningState property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied the spec from previous stable spec. The provisioningState does not have provisioningState. How do you suggest to fix this? I can remove the inner provisioningState.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The swagger should reflect faithfully the API. It just looks weird to me to have a provisiningState property inside another provisiningState property. But if that is how the service is behaving, leave it like that.
"$ref": "./definitions.json#/parameters/AutomationAccountNameParameter" | ||
}, | ||
{ | ||
"name": "$filter", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$filter [](start = 21, length = 7)
x-ms-odata extension would be valuabe for this operation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'll talk with the team and take this up as a separate PR as it is not a blocker right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is a comment for a swagger in the stable folder, I strongly recommend to get whatever is inside this folder right in one PR. This way you will avoid breaking changes on generated SDKs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ [](start = 177, length = 1)
Is this last slash really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still there :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh. It could be because of the merge issues. Fixing it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"type": "string", | ||
"description": "Gets or sets the name of the resource." | ||
}, | ||
"location": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
location [](start = 9, length = 8)
So, when regenerating keys, could the location also be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking with the team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"type": "string", | ||
"description": "Gets or sets the account id of the node." | ||
}, | ||
"nodeConfiguration": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nodeConfiguration [](start = 9, length = 17)
WDYT about flattening this property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe a little more about this? You mean the x-ms-client-flatten property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"tags": [ | ||
"DscNode" | ||
], | ||
"operationId": "DscNode_ListByAutomationAccount", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DscNode_ListByAutomationAccount [](start = 24, length = 31)
This operation could also use x-ms-odata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Thanks. I'll talk with the team and take this up as a separate PR as it is not a blocker right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"tags": [ | ||
"NodeReports" | ||
], | ||
"operationId": "NodeReports_ListByNode", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NodeReports_ListByNode [](start = 24, length = 22)
This one too, x-ms-odata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Thanks. I'll talk with the team and take this up as a separate PR as it is not a blocker right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"type": "string", | ||
"description": "Gets or sets the status of the node report." | ||
}, | ||
"refreshMode": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refreshMode [](start = 9, length = 11)
Could this be an enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't planning to enum this currently as the things being returned here are not finalized yet and are subject to change.
@mcardosos Out of the above -
Done
Removed
As you said above, this is not a blocker currently. Also, when I remove the
OData extension done. After talking to the team, the dscNodeReport enums is not in plan currently.
Will keep an eye. |
}, | ||
"interval": { | ||
"type": "integer", | ||
"format": "byte", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
byte [](start = 21, length = 4)
Does not make sense for this to be format byte, PTAL here
https://swagger.io/docs/specification/data-models/data-types/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Changed it to String/Byte format (ref: http://docs.swagger.io/spec.html)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Cool! So missing stuff to fix are linter errors and model validation errors. |
For the model issues, I already made the fix (8b68d37). Don't know why its now showing up. I'll make the commit again. As for the linter issues. It is finding linting issues in 2015-10-31 folder, which I am fixing in 2018-01-15 resources. I am not changing previous stable version to fix it. |
@mcardosos Fixed the model issues. |
"x-ms-azure-resource": true, | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/ProxyResource" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProxyResource [](start = 33, length = 13)
Shouldn't this be just Resource
? Also, since you are already doing an allof here, you dont need some of the preoperties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand this changes might be breaking changes for some SDKs. WDYT about adding these improvements into a new file that is only used by the API version introduced in this PR?
In reply to: 177918048 [](ancestors = 177918048,177918018)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But but I didn't want to change the meaning behind it. This can go to the discussion why have ProxyResource
definition at all if all the resources can be either TrackedResource
or just Resource
. Having ProxyResource
makes the spec clearer and explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the no longer needed properties?
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`. | ||
|
||
``` yaml $(tag) == 'package-2018-01-preview' && $(go) | ||
output-folder: $(go-sdk-folder)/services/automation/mgmt/2018-01-15-preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ [](start = 40, length = 1)
Add a preview folder here :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see other services adding a preview
folder or a preview folder showing up in the Go SDK repo.
Example - Data Migration and Compute. Do I need to add this then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is not problem if the golang section is left out. We will figure it out later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you suggest then, for getting the PR through? I can send a separate PR for the same.
@ravbhatnagar Could you please take a look at this PR. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! :)
Linter errors are not related to this PR, but... awareness
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL is not formed correctly. This will have RBAC issues. Is this new API or existing? Is agentInformation a resource type defined in your manifest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is existing. It's a proxy resources therefore not defined in the manifest. It's used by our portal code but not through ARM template.
"type": "string", | ||
"description": "Gets or sets the dsc server endpoint." | ||
}, | ||
"keys": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keys should not be returned as part of the GET. Only via a POST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also legacy API
}, | ||
"description": "Definition of the dsc node report error type." | ||
}, | ||
"AgentRegistration": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a resource, it is missing the name, type properties. Is the id property the ARM resource id or something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a proxy resource. Also part of existing API.
@vrdmr - Some comments. Not sure if these are existing APis or new. Please ping me to close on this. |
OK since these are all existing APis, signing off despite these issues. |
@AutorestCI regenerate azure-sdk-for-python |
…k-name-availability Add swagger support for check name availability on GitHub.Enterprise/accounts
Added spec for new 2018-01 APIs. These mainly contain spec for the DSC APIs fixing the linting issues. Also added examples, and did some housekeeping for cleaning up the existing specs and better naming things.
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-version
in the path should match theapi-version
in the spec).Quality of Swagger