-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Convert Swagger to TypeSpec for databoxedge #37236
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
f5b7a42
migrate once
haolingdong-msft 5219e4b
Fix error type for operations interface
haolingdong-msft f6a842d
add readonly visibility for paging model value
haolingdong-msft ef1abc5
fix x-ms-secret
haolingdong-msft bc155ac
update swagger
haolingdong-msft 7bf5909
update swagger
haolingdong-msft 85cfcc9
Update cspell.yaml
welovej bc24f7b
Revert "Update cspell.yaml"
welovej 1bf7baa
update
welovej 68bb7b3
update
welovej 727de32
update
welovej 9b5585e
Delete databoxedge.json
welovej 8ddfbeb
Update readme.md
welovej 4d62eb3
prettier
welovej 62e1c4e
Create client.tsp
welovej 282165f
Update client.tsp
welovej 6f01a04
Merge branch 'main' into tsp-conversion-databoxedge
mcgallan e533657
update no properties resource model and summary
mcgallan 108513e
update tspconfig
mcgallan 42cffef
Add Java SDK breaking change mitigations for TypeSpec migration
weidongxu-microsoft 78fd8f8
resolve js breaking
v-jiaodi 2937bf1
mitigate reorder breakings (#38379)
ChenxiJiang333 27dd7b3
Update client.tsp
weidongxu-microsoft bcd453b
resolve the conflicts from the folder migration.
zedy-wj 96a2a3d
Merge branch 'main' into tsp-conversion-databoxedge
mcgallan da78334
add config (#38636)
jliusan d90b6fa
Add 'go' support to DataBoxEdge client overrides
tadelesh b306ba1
format
mcgallan 71b50fc
Merge branch 'main' into tsp-conversion-databoxedge
pshao25 dc0f9ea
update
mcgallan d582a04
Merge branch 'tsp-conversion-databoxedge' of https://github.com/Azure…
mcgallan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/DataBoxEdge/Addon.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./DataBoxEdgeDevice.tsp"; | ||
| import "./VirtualResource.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.DataBoxEdge; | ||
| // FIXME: Addon has no properties property | ||
| /** | ||
| * Role Addon | ||
| */ | ||
| @discriminator("kind") | ||
| @parentResource(Role) | ||
| model Addon | ||
| is Azure.ResourceManager.Legacy.DiscriminatedProxyResource<AddonType> { | ||
| ...ResourceNameParameter< | ||
| Resource = Addon, | ||
| KeyName = "addonName", | ||
| SegmentName = "addons", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface Addons { | ||
| /** | ||
| * Gets a specific addon by name. | ||
| */ | ||
| get is AddonsOps.Read<Addon, OverrideErrorType = CloudError>; | ||
|
|
||
| /** | ||
| * Create or update a addon. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| createOrUpdate is AddonsOps.CreateOrUpdateAsync< | ||
| Addon, | ||
| Response = ArmResourceUpdatedResponse<Addon> | ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Addon> & | ||
| Azure.Core.Foundations.RetryAfterHeader>, | ||
| OverrideErrorType = CloudError | ||
| >; | ||
|
|
||
| /** | ||
| * Deletes the addon on the device. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| delete is AddonsOps.DeleteWithoutOkAsync< | ||
| Addon, | ||
| Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse, | ||
| OverrideErrorType = CloudError | ||
| >; | ||
|
|
||
| /** | ||
| * Lists all the addons configured in the role. | ||
| */ | ||
| listByRole is AddonsOps.List< | ||
| Addon, | ||
| Response = ArmResponse<AddonList>, | ||
| OverrideErrorType = CloudError | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface AddonsOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...ResourceGroupParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
|
|
||
| /** | ||
| * The name of the device. | ||
| */ | ||
| @path | ||
| @segment("dataBoxEdgeDevices") | ||
| deviceName: string, | ||
|
|
||
| /** | ||
| * The name of the role. | ||
| */ | ||
| @path | ||
| @segment("roles") | ||
| roleName: string, | ||
| }, | ||
| { | ||
| /** | ||
| * The name of the addon. | ||
| */ | ||
| @path | ||
| @segment("addons") | ||
| addonName: string, | ||
| } | ||
| > {} | ||
|
|
||
| @@doc(Addon.name, "The addon name."); | ||
| @@doc(Addons.createOrUpdate::parameters.resource, "The addon properties."); | ||
| @@doc(Addon.kind, "Addon type."); | ||
46 changes: 46 additions & 0 deletions
46
specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/DataBoxEdge/Alert.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./DataBoxEdgeDevice.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.DataBoxEdge; | ||
| /** | ||
| * Alert on the data box edge/gateway device. | ||
| */ | ||
| @parentResource(DataBoxEdgeDevice) | ||
| model Alert is Azure.ResourceManager.ProxyResource<AlertProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = Alert, | ||
| KeyName = "name", | ||
| SegmentName = "alerts", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface Alerts { | ||
| /** | ||
| * Gets an alert by name. | ||
| */ | ||
| @summary("Gets an alert by name.") | ||
| get is ArmResourceRead<Alert, Error = CloudError>; | ||
|
|
||
| /** | ||
| * Gets all the alerts for a Data Box Edge/Data Box Gateway device. | ||
| */ | ||
| listByDataBoxEdgeDevice is ArmResourceListByParent< | ||
| Alert, | ||
| Response = ArmResponse<AlertList>, | ||
| Error = CloudError | ||
| >; | ||
| } | ||
|
|
||
| @@doc(Alert.name, "The alert name."); | ||
| @@doc(Alert.properties, "Properties of alert."); |
72 changes: 72 additions & 0 deletions
72
...tion/databoxedge/resource-manager/Microsoft.DataBoxEdge/DataBoxEdge/BandwidthSchedule.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./DataBoxEdgeDevice.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.DataBoxEdge; | ||
| /** | ||
| * The bandwidth schedule details. | ||
| */ | ||
| @parentResource(DataBoxEdgeDevice) | ||
| model BandwidthSchedule | ||
| is Azure.ResourceManager.ProxyResource<BandwidthScheduleProperties, false> { | ||
| ...ResourceNameParameter< | ||
| Resource = BandwidthSchedule, | ||
| KeyName = "name", | ||
| SegmentName = "bandwidthSchedules", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface BandwidthSchedules { | ||
| /** | ||
| * Gets the properties of the specified bandwidth schedule. | ||
| */ | ||
| get is ArmResourceRead<BandwidthSchedule, Error = CloudError>; | ||
|
|
||
| /** | ||
| * Creates or updates a bandwidth schedule. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| createOrUpdate is ArmResourceCreateOrReplaceAsync< | ||
| BandwidthSchedule, | ||
| Response = ArmResourceUpdatedResponse<BandwidthSchedule> | ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = BandwidthSchedule> & | ||
| Azure.Core.Foundations.RetryAfterHeader>, | ||
| Error = CloudError | ||
| >; | ||
|
|
||
| /** | ||
| * Deletes the specified bandwidth schedule. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| delete is ArmResourceDeleteWithoutOkAsync< | ||
| BandwidthSchedule, | ||
| Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse, | ||
| Error = CloudError | ||
| >; | ||
|
|
||
| /** | ||
| * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. | ||
| */ | ||
| listByDataBoxEdgeDevice is ArmResourceListByParent< | ||
| BandwidthSchedule, | ||
| Response = ArmResponse<BandwidthSchedulesList>, | ||
| Error = CloudError | ||
| >; | ||
| } | ||
|
|
||
| @@doc(BandwidthSchedule.name, "The bandwidth schedule name."); | ||
| @@doc(BandwidthSchedule.properties, | ||
| "The properties of the bandwidth schedule." | ||
| ); | ||
| @@doc(BandwidthSchedules.createOrUpdate::parameters.resource, | ||
| "The bandwidth schedule to be added or updated." | ||
| ); |
81 changes: 81 additions & 0 deletions
81
specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/DataBoxEdge/Container.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./StorageAccount.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.DataBoxEdge; | ||
| /** | ||
| * Represents a container on the Data Box Edge/Gateway device. | ||
| */ | ||
| @parentResource(StorageAccount) | ||
| model Container | ||
| is Azure.ResourceManager.ProxyResource<ContainerProperties, false> { | ||
| ...ResourceNameParameter< | ||
| Resource = Container, | ||
| KeyName = "containerName", | ||
| SegmentName = "containers", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface Containers { | ||
| /** | ||
| * Gets a container by name. | ||
| */ | ||
| @summary("Gets a container by name.") | ||
| get is ArmResourceRead<Container, Error = CloudError>; | ||
|
|
||
| /** | ||
| * Creates a new container or updates an existing container on the device. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @summary("Creates a new container or updates an existing container on the device.") | ||
| createOrUpdate is ArmResourceCreateOrReplaceAsync< | ||
| Container, | ||
| Response = ArmResourceUpdatedResponse<Container> | ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Container> & | ||
| Azure.Core.Foundations.RetryAfterHeader>, | ||
| Error = CloudError | ||
| >; | ||
|
|
||
| /** | ||
| * Deletes the container on the Data Box Edge/Data Box Gateway device. | ||
| */ | ||
| delete is ArmResourceDeleteWithoutOkAsync<Container, Error = CloudError>; | ||
|
|
||
| /** | ||
| * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. | ||
| */ | ||
| @summary("Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device.") | ||
| listByStorageAccount is ArmResourceListByParent< | ||
| Container, | ||
| Response = ArmResponse<ContainerList>, | ||
| Error = CloudError | ||
| >; | ||
|
|
||
| /** | ||
| * Refreshes the container metadata with the data from the cloud. | ||
| */ | ||
| @summary("Refreshes the container metadata with the data from the cloud.") | ||
| refresh is ArmResourceActionAsync< | ||
| Container, | ||
| void, | ||
| OkResponse, | ||
| Error = CloudError, | ||
| LroHeaders = Azure.Core.Foundations.RetryAfterHeader & | ||
| ArmLroLocationHeader<FinalResult = void> | ||
| >; | ||
| } | ||
|
|
||
| @@doc(Container.name, "The container Name"); | ||
| @@doc(Container.properties, "The container properties."); | ||
| @@doc(Containers.createOrUpdate::parameters.resource, | ||
| "The container properties." | ||
| ); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.