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

[Not Swagger] API profile map for the profile version 2017-03-09-profile #2895

Merged
merged 7 commits into from
Jun 5, 2018

Conversation

bganapa
Copy link
Member

@bganapa bganapa commented Apr 18, 2018

This is not a swagger file. This PR is to discuss the API-Profile map format. Added the map for the existing azure stack specific api-profile 2017-03-09-profile

@AutorestCI
Copy link

AutorestCI commented Apr 18, 2018

Automation for azure-sdk-for-node

Unable to detect any generation context from this PR.

@AutorestCI
Copy link

AutorestCI commented Apr 18, 2018

Automation for azure-sdk-for-python

Unable to detect any generation context from this PR.

@AutorestCI
Copy link

AutorestCI commented Apr 18, 2018

Automation for azure-libraries-for-java

Unable to detect any generation context from this PR.

@AutorestCI
Copy link

AutorestCI commented Apr 18, 2018

Automation for azure-sdk-for-go

Unable to detect any generation context from this PR.

"types": {}
},
"microsoft.subscription": {
"version": "2016-02-01"
Copy link
Contributor

Choose a reason for hiding this comment

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

there is subscription section under microsoft.resources with the different API version. Aren't they gona conflict?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its a mistake. I am fixing. Subscriptions is not a resource type under resources namespace. Going to remove from here. Thanks for taking a look. I am going to send a mail after adding a readme.md on the structure

"version": "2016-02-01",
"types": {
"links": "2016-09-01",
"subscriptions": "2016-06-01"
Copy link
Member Author

Choose a reason for hiding this comment

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

subscriptions is not a RT under microsoft.resources

@@ -0,0 +1,48 @@
{
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 file should probably get in to the existing profiles folder

},
"microsoft.compute": {
"version": "2016-03-30",
"types": {}
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we need to mandate specifying empty types: {}

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no schema for the profile AFAIK. What docs did you use to create this file?

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 dont have schema yet. This is just a result of internal discussion with SDK team

Copy link

Choose a reason for hiding this comment

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

@hovsepm this PR will by default define the schema. I'm +1 on allowing skipping empty properties.

Copy link
Member Author

Choose a reason for hiding this comment

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

Keeping empty types{} could be helpful for easy parsing , Im keeping it for now. we can discuss this in our meeting

@hovsepm
Copy link
Contributor

hovsepm commented Apr 18, 2018

@joshgav could you review this PR?

@hovsepm hovsepm removed their assignment Apr 18, 2018
An API profile represents a map of resource provider namespaces and their API versions. It is a representation of an Azure Platform declaring a set of APIs to be supported across all our clouds.Instead of specifying individual api-versions for each resource type across each namespace, the developer can just align the application to a profile and the tools/SDKs will themselves revert to the right api-versions as directed by the profile. With API Profiles developers can specify a profile version that applies to an entire template and, at runtime, ARM will pick the right versions of the resources. This way, the customers don’t have to worry about which are the right resource versions to specific clouds.


<<Insert detailed documentation link here>>
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to be temporary placeholders. Could you add the actual link?

Copy link
Member Author

Choose a reason for hiding this comment

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

added the link

| | +---"version":"xxxx-xx-xx",
| | +---"types":{
| | +---"resourcetype3":"xxxx-xx-xx",
| | +---"resourcetype4":"xxxx-xx-xx"
Copy link
Member Author

Choose a reason for hiding this comment

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

How do we handle nested resource type supporting a different api-version than the parent resource type? This is not a concern for now, but our format should be able to handle this

Copy link
Member

Choose a reason for hiding this comment

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

Should use the syntax of the providers call:
"resourceType": "storageAccounts/services/metricDefinitions"

},
"microsoft.network": {
"version": "2015-06-15",
"types": {}

Choose a reason for hiding this comment

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

I would rather be more verbose than less. List out the individual resource types here explicitly.

Copy link
Member

Choose a reason for hiding this comment

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

Personally I fine to be less explicit, for the point I made here just after.

Choose a reason for hiding this comment

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

I expect this map to be used to create the schemas that Visual Studio can consume and aid (intellisense, etc) in authoring templates within the IDE, along with SDKs generation. I want this to be a generic map which could serve multiple uses. In that case, if it is not explicitly verbose, i.e., if all the resource types and corresponding API versions are not listed, I am not sure how useful this is.

Also, if sometime down the line ARM decides to provide an API to retrieve cloud capabilities based on profile versions, this map could serve as a starting manifest or this in itself could become a manifest.

Copy link

Choose a reason for hiding this comment

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

Either way is okay with me, people looking to this file for guidance can learn to skip or minimize those sections. For purposes of excluding types, though, as discussed below, it may be best to list them all minus the excluded ones.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is Open Issue 1

@bganapa
Copy link
Member Author

bganapa commented Apr 19, 2018

@joshgav added 2018-03-01-hybrid json

"version": "2018-02-01",
"types": {
"extensionsMetadata": "2015-01-01",
"offers": "2015-01-01"
Copy link
Member Author

Choose a reason for hiding this comment

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

/offers is specific to azurestack and i do not think we need to include it here since we dont have swaggers yet

Copy link
Member

Choose a reason for hiding this comment

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

Endpoint availability and Swagger are two differents things. If offers exists, and then this file is an accurate description of the endpoint, it's nice to have it here. Swagger can come later, and will match that.

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 think without swagger, it is not goign to be meaningful to keep it here as SDKs would refer this json and likely fail as it is not goign to find a swagger?

Copy link
Member

Choose a reason for hiding this comment

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

They are not supposed to fail if the Swagger doesn't exist. It depends how this file is interpreted, and again, what is the purpose of this file. Is this a Stack only file? A generic file? etc.

Copy link

Choose a reason for hiding this comment

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

Profiles on the whole are generic, though the two in this PR are only for use with Stack. There will be others not intended for Stack soon. The purpose of profile specs is to provide a canonical definition which all downstream things can turn to - e.g. SDKs and docs.

},
"microsoft.network": {
"version": "2015-06-15",
"types": {}
Copy link
Member Author

Choose a reason for hiding this comment

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

How do we handle the Not supported resource type in an api-version? e.g though azurestack supports 2015-06-15 api version for microsoft.network, it does not support applicationGateway resource type

Copy link
Member

Choose a reason for hiding this comment

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

It depends how you interpret this file IMHO. Is this a Stack only file or not?
If not, and we're saying "Everything that is under Microsoft.Network should be called with 2015-06-15" and that's fine for Public Azure. Stack gateway will complain that the RT doesn't exist, and it's a fine error as well.

Copy link

Choose a reason for hiding this comment

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

If someone builds an app on this profile it should work with both Stack and Azure - that's the promise of profiles. Profiles themselves are generic, Stack happens to snap to a specific profile.

An app developer might build an app with a profile on public Azure, then expect it to run on Stack. For that case I think we need to somehow spec that a resource type isn't supported in a given profile; that's only part of the problem though, the SDKs aren't designed to exclude use of certain types I don't think.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an Open issue 2

@knithinc
Copy link

@devigned could you please review the profile map and provide feedback.

},
"microsoft.compute": {
"version": "2016-03-30",
"types": {}
Copy link
Member

Choose a reason for hiding this comment

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

We must have virtualMachineScaleSets here with 2015-06-15 (the Network ApiVersion). This file should not replicate the Swagger mistake of considering that virtualMachineScaleSets is a Network RP.

Copy link
Member

Choose a reason for hiding this comment

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

I retract that comment, after discussing with @johanste

@joshgav
Copy link

joshgav commented Apr 27, 2018

@johanste @sphibbs @devigned @lmazuel @marstr @salameer this PR describes the last two hybrid profiles in a machine-readable way. We will use this for reference and automatic generation. Does this proposal meet those use cases for all languages? Thanks!

"version": "2016-01-01",
"types": {}
},
"microsoft.subscription": {
Copy link
Member

Choose a reason for hiding this comment

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

This is false, Microsoft.Subscription exists, but it's not what you mean here:
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json#L19

This is tough because the URL is https://management.azure.com/subscriptions?api-version=2016-06-01 that does not involve RP.
When we list providers, how this one is listed?

Copy link
Member

@lmazuel lmazuel Apr 27, 2018

Choose a reason for hiding this comment

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

If you do az provider list, you get:

    "namespace": "Microsoft.Resources",
...
        "apiVersions": [
          "2018-02-01",
          "2018-01-01",
          "2017-08-01",
          "2017-06-01",
          "2017-05-10",
          "2017-05-01",
          "2017-03-01",
          "2016-09-01",
          "2016-07-01",
          "2016-06-01",
          "2016-02-01",
          "2015-11-01",
          "2015-01-01",
          "2014-04-01-preview"
        ],
        "locations": [],
        "properties": null,
        "resourceType": "subscriptions"

which is probably what I would use for consistency

Microsoft.Subscription is REALLY something else:

    "namespace": "Microsoft.Subscription",
    "registrationState": "NotRegistered",
    "resourceTypes": [
      {
        "aliases": null,
        "apiVersions": [
          "2017-11-01-preview"
        ],
        "locations": [
          "West US"
        ],
        "properties": null,
        "resourceType": "SubscriptionDefinitions"
      },

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 am going to remove microsoft.subscription from this list and we should model Subscription as a resource type under Microsoft.Resources

Copy link

Choose a reason for hiding this comment

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

thanks @bganapa

"version": "2018-02-01",
"types": {
"extensionsMetadata": "2015-01-01",
"offers": "2015-01-01"
Copy link
Member

Choose a reason for hiding this comment

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

Endpoint availability and Swagger are two differents things. If offers exists, and then this file is an accurate description of the endpoint, it's nice to have it here. Swagger can come later, and will match that.

| | +---"version":"xxxx-xx-xx",
| | +---"types":{
| | +---"resourcetype3":"xxxx-xx-xx",
| | +---"resourcetype4":"xxxx-xx-xx"
Copy link
Member

Choose a reason for hiding this comment

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

Should use the syntax of the providers call:
"resourceType": "storageAccounts/services/metricDefinitions"

@@ -0,0 +1,47 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to see a metadata property in this object, to remove any semantics from the name of this file/structure of the repository its living in.

For example:

"info":{
    "title":"2017-03-09",
    "description":"<A brief overview of whom it is that is expected to consume this profile, and under which circumstances.>"
},
"resource-manager":{
 ...
}

Copy link

Choose a reason for hiding this comment

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

this wouldn't hurt IMHO. there are probably other properties we'll want here too

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a info node

Copy link
Member

Choose a reason for hiding this comment

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

Sorry to bother you again, but could you include a title or name property in the info block?

Copy link
Member Author

Choose a reason for hiding this comment

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

added

"locks":"2015-01-01",
"policyassignments": "2015-10-01-preview",
"policydefinitions": "2015-10-01-preview"
}
Copy link
Member

Choose a reason for hiding this comment

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

My interpretation of the API Versions above is that operations not associated with a particular type should be populated from "2015-07-01" and type specific operations should come from the API Version specified. In this case:

  • locks -> "2015-01-01"
  • policyassignements -> "2015-10-01-preview"
  • policydefinitions -> "2015-10-01-preview"

Is my interpretation correct?

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, That is correct

The files in the folder describe the map of each resource provider's resource types and their supported api versions in the api profile.

## Basics
An API profile represents a map of resource provider namespaces and their API versions. It is a representation of an Azure Platform declaring a set of APIs to be supported across all our clouds.Instead of specifying individual api-versions for each resource type across each namespace, the developer can just align the application to a profile and the tools/SDKs will themselves revert to the right api-versions as directed by the profile. With API Profiles developers can specify a profile version that applies to an entire template and, at runtime, ARM will pick the right versions of the resources. This way, the customers don’t have to worry about which are the right resource versions to specific clouds.
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the word "revert" here, it sounds negative. How about "select"?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

## File Structure
<<Todo: Define a json schema file if it helps>>

The profile is an one to one map. The api version specified is a single version for the resource type, although the reource type could support other older api versions as well.
Copy link
Member

Choose a reason for hiding this comment

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

Grammar: "The profile is a one to one map"

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@joshgav
Copy link

joshgav commented May 15, 2018

Hi @bganapa - looks good to me! Can you address @marstr and @lmazuel's comments as you've proposed so we can merge? I think this remains:

  • we may need to add all resource types so that unsupported ones can be excluded
  • add a "info" object for metadata
  • fix items clarified by @lmazuel

Thanks!

@azuresdkciprbot
Copy link

AutoRest linter results for ARM Related Validation Errors/Warnings

These errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns.

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for SDK Related Validation Errors/Warnings

These errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns.

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@joshgav
Copy link

joshgav commented May 16, 2018

Thanks @bganapa! I believe the only remaining question is whether to list all resource types explicitly. I'm +1 on that cause it will allow us to exclude unsupported types. @lmazuel @johanste @marstr thoughts?

Copy link
Member

@marstr marstr left a comment

Choose a reason for hiding this comment

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

Approving so that my status isn't blocking, but I'd still like to see a name/title property added.

@joshgav
Copy link

joshgav commented May 23, 2018

Hi @bganapa! Can you please add the individual resource types under their provider? We all agreed to this in another thread. Can you also add a "name" property to the metadata section per @marstr's comment? Thank you!

@AutorestCI
Copy link

AutorestCI commented May 23, 2018

Automation for azure-sdk-for-ruby

Unable to detect any generation context from this PR.

@bganapa
Copy link
Member Author

bganapa commented May 23, 2018

@joshgav Added the resource types explicitly . Note that this changes the file format quite a bit. we can discuss in today's meeting. This needs another commit as i am yet to update the readme and Microsoft.web resource types, I am also waiting on confiration for the exact set of resource types that we support for the new 2018* profile

@joshgav
Copy link

joshgav commented May 30, 2018

Thanks @bganapa! I just checked the versions referenced in the 2018-03-01 profile and find many of the versions don't exist in the specifications/ directory in this repo, which is a prerequisite for generating libs. Do these versions exist in public Azure APIs? If not, the value of a hybrid profile is lost. If yes, can you add specs for them to the repo?

Thank you!

FYI @johanste

]
},
"microsoft.resources": {
"2017-10-01": [
Copy link

Choose a reason for hiding this comment

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

version doesn't exist

"subscriptions/tagNames/tagValues",
"tenants"
],
"2015-01-01": [
Copy link

Choose a reason for hiding this comment

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

version doesn't exist

Copy link

Choose a reason for hiding this comment

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

decided in f2f meeting that we should remove this version completely since types are only for Stack

@joshgav
Copy link

joshgav commented May 30, 2018

remaining: verify Web entries are correct, remove Stack-specific types, and update README.

then merge!!

"resource-manager": {
"microsoft.authorization": {
"2017-04-01": [
"locks"
Copy link
Contributor

Choose a reason for hiding this comment

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

"2016-09-01": [
"locks"
],
"2015-07-01": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

if you are looking roleassignments, they are here.
Microsoft.Azuthorization specs are in two different places :( (they are owned by two different teams)

https://github.com/Azure/azure-rest-api-specs/tree/master/specification/authorization/resource-manager/Microsoft.Authorization/stable/2015-07-01

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh gotcha. Sorry about the confusion

"policyAssignments",
"policyDefinitions"
],
"2015-07-01-preview": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Not this one either.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems azure team has left out specifying this providerOperations resource type for this api-version. This is not critical resource type and i am removing it from the profile map

]
},
"microsoft.web": {
"2015-02-01":[
Copy link
Contributor

Choose a reason for hiding this comment

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

"providers",
"resourceGroups",
"resources",
"subscriptions",
Copy link
Contributor

Choose a reason for hiding this comment

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

…ings under Web, picking up available swagger versions for /subscriptions
@bganapa
Copy link
Member Author

bganapa commented Jun 4, 2018

@jianghaolu please let me know if you find any other issue. @joshgav This should be good to merge..

@joshgav
Copy link

joshgav commented Jun 5, 2018

Thanks @bganapa! Working on merging this now.

@marstr marstr merged commit b29373c into Azure:master Jun 5, 2018
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.

9 participants