-
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
AzureStack InfrastructureInsights Admin Specification #2812
AzureStack InfrastructureInsights Admin Specification #2812
Conversation
Automation for azure-sdk-for-goThis PR contains more than 3 context, SDK generation is not enabled. Contexts found:
|
Automation for azure-libraries-for-javaThis PR contains more than 3 context, SDK generation is not enabled. Contexts found:
|
Automation for azure-sdk-for-pythonThis PR contains more than 3 context, SDK generation is not enabled. Contexts found:
|
Automation for azure-sdk-for-nodeThis PR contains more than 3 context, SDK generation is not enabled. Contexts found:
|
@@ -0,0 +1,336 @@ | |||
{ | |||
"swagger": "2.0", |
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 = 0, length = 4)
Could 2 space idents be used instead?
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.
Is there a technical reason that 2 spaces is preferred? I prefer 4 spaces.
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.
@deathly809 @mcardosos I would recommend to have a separate PR to fix an indent after this one. Please, leave the indent as it is for this PR so it's easy to review.
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 would prefer the 2 spaces indent to be fixed here, actually.
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 prefer 4 spaces and there is no requirement on spacing.
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.
Personally, in general I prefer 4 spaces too. But consistency on the repo is important, and it makes reviewing a lot easier / less noisy / faster.
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.
So far my PRs have been 4 spaces. No one has been able to point to a requirement and I have a hard time reading 2 spaces.
@@ -43,17 +43,6 @@ input-file: | |||
--- | |||
# Code Generation | |||
|
|||
|
|||
## Swagger to SDK | |||
|
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.
Why is this being deleted?
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.
Not sure, I will revert it.
@mcardosos This is not a stable API, not sure why it is marked as such. Should I change the folder to preview? |
If it is an API version where there will be changes, yes, please move to preview |
``` | ||
|
||
## C# | ||
## C# | ||
|
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 are many code generation settings on this file that I am not sure why they are gone :( They are very useful for us SDK teams
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 currently will only support C#. We have no plans for anything else at this time.
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.
Why are there no plans for other SDKs yet?
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.
Please message my manager.
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 already talked :D
@@ -42,6 +45,9 @@ | |||
"schema": { | |||
"$ref": "#/definitions/AlertList" | |||
} | |||
}, | |||
"404": { | |||
"description": "NOT FOUND" | |||
} |
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.
Unsuccessful response codes should not be included
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 team prefers not to throw an error on 404 and instead return null.
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 see. I highly recommend not setting it like this: other swaggers / SDKs do not follow this pattern, and it can be confusing for users when a SDK behaves in a different way.
In reply to: 181145822 [](ancestors = 181145822)
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 will bring this up with the PM who is leading the admin spec/SDK/PS push.
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 did you conclude there?
@@ -88,6 +97,9 @@ | |||
"schema": { | |||
"$ref": "#/definitions/Alert" | |||
} | |||
}, | |||
"404": { | |||
"description": "NOT FOUND" | |||
} |
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 here, unsuccessful responses should not be included
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 team prefers not to throw an error on 404 and instead return null.
"$ref": "InfrastructureInsights.json#/parameters/ResourceGroupParameter" | ||
}, | ||
{ | ||
"$ref": "InfrastructureInsights.json#/parameters/RegionParameter" |
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.
RegionParameter [](start = 73, length = 15)
Is this paramater required? it does not look like 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.
yes it is required, it is the {location} parameter in the URI.
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.
@mcardosos Moved to preview, some of your responses have been removed but I responded. |
"type": "string", | ||
"x-ms-parameter-location": "method" | ||
}, | ||
"RegionParameter": { |
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.
RegionParameter [](start = 9, length = 15)
A more accurate name could be LocationParameter
#Resolved
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. #Resolved
@mcardosos Is there anything else I should do? |
This looks good. Last question is on the response status codes. |
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
} | ||
} | ||
}, | ||
"definitions": { |
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 [](start = 5, length = 11)
There are a bunch of definitions that are not being used on this file, are they being used at all?
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 see that every definition in this file is referenced somewhere else. I know for a fact the other definitions in the other files are referenced. Looks like everything is referenced somewhere.
@mcardosos Everything look good? |
} | ||
} | ||
}, | ||
"Resource": { |
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.
Resource [](start = 9, length = 8)
This definition should follow this patterns instead
"Resource": {
"description": "The core properties of ARM resources",
"properties": {
"id": {
"readOnly": true,
"type": "string",
"description": "Fully qualified resource Id for the resource"
},
"name": {
"readOnly": true,
"type": "string",
"description": "The name of the resource"
},
"type": {
"readOnly": true,
"type": "string",
"description": "The type of the resource."
}
},
"x-ms-azure-resource": true
},
"TrackedResource": {
"description": "The resource model definition for a ARM tracked top level resource",
"properties": {
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-ms-mutability": [
"read",
"create",
"update"
],
"description": "Resource tags."
},
"location": {
"type": "string",
"x-ms-mutability": [
"read",
"create"
],
"description": "The Azure Region where the resource lives"
}
},
"allOf": [
{
"$ref": "#/definitions/Resource"
}
]
},
"ProxyResource": {
"description": "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags",
"allOf": [
{
"$ref": "#/definitions/Resource"
}
]
},
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 explain why? Who would reference TrackedResource and who would reference 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.
Tracked resource is for those resources that have location and tags (for example, a VM).
Proxy resource is for those other resources that happen to be derived of other resources, and therefore, they don't have a location/tags (for example, a VM extension).
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.
@mcardosos I still don't understand why you want me to add this. Looking at fiddler all my resources have a location and tags on the returned objects. Are you saying I should make it so nested resources cannot access those fields anymore?
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 they have location and tags, they should have an allof of trackedresource
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.
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
@mcardosos I have made the change you have suggested, please let me know if there is anything 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.
Awesome! Are this changes already available in the API?
@mcardosos What do you mean? What we have in the spec is what is supported by the FRP currently. At least that is what the PM and some of the developers have told me. |
The specification has been regenerated.
PR information
api-version
in the path should match theapi-version
in the spec).Quality of Swagger