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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify custom API version on resources #2467

Open
Tracked by #2194
danielrbradley opened this issue May 24, 2023 · 5 comments
Open
Tracked by #2194

Specify custom API version on resources #2467

danielrbradley opened this issue May 24, 2023 · 5 comments
Labels
area/providers impact/accessibility Something that is difficult or impossible for some people to use impact/regression Something that used to work, but is now broken kind/enhancement Improvements or new features size/M Estimated effort to complete (up to 5 days).

Comments

@danielrbradley
Copy link
Member

danielrbradley commented May 24, 2023

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

In version 2 of the provider we're removing selected resources to reduce SDK size where the next version of the resource is compatible with the previous verion. In theory API behaviour can vary between versions and a user might want to use a specific version.

To ensure that the provider allows a user to interact with the full Azure surface area, we could add a string ApiVersion field to all resources which would allow the same SDK class to be used with other versions.

Initially this could be just a string field but could also be implemented to include an enum of known versions for that resource.

If the user specifies an invalid API version or a version that's incompatible with the resources shape of the SDK resource class then errors would just be propegated by the Azure API - we would not validate this. We could also consider disabling validation of properties if the version is specified in case transformations are also being used to manipulate the shape of the payload.

Affected area/feature

  • Schema generation
  • Provider

Use cases

@danielrbradley danielrbradley added kind/enhancement Improvements or new features size/M Estimated effort to complete (up to 5 days). impact/accessibility Something that is difficult or impossible for some people to use area/providers labels May 24, 2023
@thomas11
Copy link
Contributor

thomas11 commented Aug 9, 2023

resolves #1877

@danielrbradley
Copy link
Member Author

@thomas11 I don't think this does solve the specific use case in #1877 - that is for resources which don't exist in any way in the SDK rather than a different version of an existing resource.

@thomas11
Copy link
Contributor

@danielrbradley the "resource doesn't exist in the SDK" case is covered by #68. Whereas #1877 is explicitly about API versions - although the semantics of the use case may differ. We should clarify this.

@danielrbradley
Copy link
Member Author

@thomas11 ah yes your right - custom resource providers meaning API versions we don't support.

@danielrbradley
Copy link
Member Author

Discussion points with @mikhailshilkov

  1. Consider property naming to make it clear it's an "escape hatch". E.g. OverrideApiVersion
  2. Add to the 2.0 migration guide for maintaining any v1 resource versions.
  3. Add to the provider documentation to explain how it works & what it's for. Include details about using transformations to modify payload if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/providers impact/accessibility Something that is difficult or impossible for some people to use impact/regression Something that used to work, but is now broken kind/enhancement Improvements or new features size/M Estimated effort to complete (up to 5 days).
Projects
None yet
Development

No branches or pull requests

3 participants