Skip to content
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

Merged
merged 9 commits into from
Apr 20, 2018

Conversation

deathly809
Copy link
Member

@deathly809 deathly809 commented Apr 4, 2018

The specification has been regenerated.

PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@AutorestCI
Copy link

AutorestCI commented Apr 4, 2018

Automation for azure-sdk-for-go

This PR contains more than 3 context, SDK generation is not enabled. Contexts found:

  • azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin
  • azsadmin/resource-manager/InfrastructureInsights/Microsoft.InfrastructureInsights.Admin
  • azsadmin/resource-manager/InfrastructureInsights
  • azsadmin/resource-manager/infrastructureinsights

@AutorestCI
Copy link

AutorestCI commented Apr 4, 2018

Automation for azure-libraries-for-java

This PR contains more than 3 context, SDK generation is not enabled. Contexts found:

  • azsadmin/resource-manager/InfrastructureInsights/Microsoft.InfrastructureInsights.Admin
  • azsadmin/resource-manager/InfrastructureInsights
  • azsadmin/resource-manager/infrastructureinsights
  • azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin

@AutorestCI
Copy link

AutorestCI commented Apr 4, 2018

Automation for azure-sdk-for-python

This PR contains more than 3 context, SDK generation is not enabled. Contexts found:

  • azsadmin/resource-manager/InfrastructureInsights
  • azsadmin/resource-manager/infrastructureinsights
  • azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin
  • azsadmin/resource-manager/InfrastructureInsights/Microsoft.InfrastructureInsights.Admin

@AutorestCI
Copy link

AutorestCI commented Apr 4, 2018

Automation for azure-sdk-for-node

This PR contains more than 3 context, SDK generation is not enabled. Contexts found:

  • azsadmin/resource-manager/InfrastructureInsights/Microsoft.InfrastructureInsights.Admin
  • azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin
  • azsadmin/resource-manager/InfrastructureInsights
  • azsadmin/resource-manager/infrastructureinsights

@@ -0,0 +1,336 @@
{
"swagger": "2.0",
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

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?

Copy link
Member Author

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.

@deathly809
Copy link
Member Author

@mcardosos This is not a stable API, not sure why it is marked as such. Should I change the folder to preview?

@mcardosos
Copy link
Contributor

If it is an API version where there will be changes, yes, please move to preview

```

## C#
## C#

Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please message my manager.

Copy link
Contributor

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"
}
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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)

Copy link
Member Author

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.

Copy link
Contributor

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"
}
Copy link
Contributor

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

Copy link
Member Author

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"
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okok, nevermind


In reply to: 181146243 [](ancestors = 181146243)

@deathly809
Copy link
Member Author

@mcardosos Moved to preview, some of your responses have been removed but I responded.

"type": "string",
"x-ms-parameter-location": "method"
},
"RegionParameter": {
Copy link
Contributor

@mcardosos mcardosos Apr 12, 2018

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

Copy link
Member Author

@deathly809 deathly809 Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. #Resolved

@deathly809
Copy link
Member Author

@mcardosos Is there anything else I should do?

@mcardosos
Copy link
Contributor

This looks good. Last question is on the response status codes.

@azuresdkciprbot
Copy link

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: specification/azsadmin/resource-manager/infrastructureinsights/readme.md
Before the PR: Warning(s): 0 Error(s): 0
After the PR: Warning(s): 0 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

}
}
},
"definitions": {
Copy link
Contributor

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?

Copy link
Member Author

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.

@deathly809
Copy link
Member Author

@mcardosos Everything look good?

}
}
},
"Resource": {
Copy link
Contributor

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"
        }
      ]
    },

Copy link
Member Author

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?

Copy link
Contributor

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).

Copy link
Member Author

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?

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@azuresdkciprbot
Copy link

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: specification/azsadmin/resource-manager/infrastructureinsights/readme.md
Before the PR: Warning(s): 0 Error(s): 0
After the PR: Warning(s): 0 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@deathly809
Copy link
Member Author

@mcardosos I have made the change you have suggested, please let me know if there is anything else.

Copy link
Contributor

@mcardosos mcardosos left a 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?

@deathly809
Copy link
Member Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants