-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[migration] recoveryservicesbackup to TypeSpec #35709
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 16 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
b9a43fc
init conversion version
tadelesh afa5c86
fix
tadelesh 69217b1
update operation id
tadelesh 5c49eac
update
tadelesh c4465e9
fix
tadelesh 8adf0fc
fix
tadelesh be7c6fb
format
tadelesh 2377ea6
fix
tadelesh a46a2c1
Merge branch 'main' into recovery_service_backup_typespec
tadelesh e08d175
update
85b875d
Merge remote-tracking branch 'origin/main' into recovery_service_back…
37e19ba
update
7d843e1
Merge branch 'recovery_service_backup_typespec' of github.com:Azure/a…
8411141
Merge branch 'main' into recovery_service_backup_typespec
tadelesh 8bd0d6a
Merge branch 'main' into recovery_service_backup_typespec
msyyc d42db6f
fix python
msyyc 6fab214
Merge branch 'main' into recovery_service_backup_typespec
tadelesh 44c2015
update
8960d93
update
046b887
java backward compatible
weidongxu-microsoft 10bdc7b
Add Java SDK breaking change mitigations for TypeSpec migration
weidongxu-microsoft bbd0831
java backward compatible
weidongxu-microsoft 2b6d01d
fix plural
weidongxu-microsoft b989162
java backward compatible
weidongxu-microsoft 4c8c486
Fix Java SDK breaking changes for UTC, PIN, VM abbreviations
weidongxu-microsoft 58cc136
java backward compatible
weidongxu-microsoft 7439f22
merge ResourceGuardProxy and ResourceGuardProxies
weidongxu-microsoft 2545b16
update
7fb44f3
update fixme
5e497d9
change to legacy operations list
5db1c31
fix
c07cddb
update
871d592
fix
665eccf
Merge branch 'main' into recovery_service_backup_typespec
tadelesh ddc737a
resolve breaking
v-jiaodi 412265b
fix ordering and go config
7944849
Merge branch 'recovery_service_backup_typespec' of github.com:Azure/a…
a68b823
update
c7778df
update
e810a1f
update
58d94c4
update
bfc3028
update
03a4aad
fix
e309813
fix
d7a0edf
fix
84c7f5a
resolve js model duplicate
v-jiaodi 4f34bb4
Update ProtectionPolicies_Delete.json
bc90e78
fix cspell
XiaofeiCao 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
83 changes: 83 additions & 0 deletions
83
...ification/recoveryservicesbackup/RecoveryServices.Management/BackupEngineBaseResource.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,83 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
|
||
namespace Microsoft.RecoveryServices; | ||
/** | ||
* The base backup engine class. All workload specific backup engines derive from this class. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" | ||
@parentResource(VaultResource) | ||
@Azure.ResourceManager.Private.armResourceInternal(BackupEngineBase) | ||
@Azure.ResourceManager.Legacy.customAzureResource | ||
@Http.Private.includeInapplicableMetadataInPayload(false) | ||
model BackupEngineBaseResource extends Resource { | ||
...ResourceNameParameter< | ||
Resource = BackupEngineBaseResource, | ||
KeyName = "backupEngineName", | ||
SegmentName = "backupEngines", | ||
NamePattern = "" | ||
>; | ||
|
||
/** | ||
* BackupEngineBaseResource properties | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" | ||
properties?: BackupEngineBase; | ||
} | ||
|
||
@armResourceOperations | ||
interface BackupEngines { | ||
/** | ||
* Returns backup management server registered to Recovery Services Vault. | ||
*/ | ||
get is ArmResourceRead< | ||
BackupEngineBaseResource, | ||
Parameters = { | ||
/** | ||
* OData filter options. | ||
*/ | ||
@query("$filter") | ||
$filter?: string; | ||
|
||
/** | ||
* skipToken Filter. | ||
*/ | ||
@query("$skipToken") | ||
$skipToken?: string; | ||
} | ||
>; | ||
|
||
/** | ||
* Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. | ||
*/ | ||
@list | ||
list is ArmResourceListByParent< | ||
BackupEngineBaseResource, | ||
Parameters = { | ||
/** | ||
* OData filter options. | ||
*/ | ||
@query("$filter") | ||
$filter?: string; | ||
|
||
/** | ||
* skipToken Filter. | ||
*/ | ||
@query("$skipToken") | ||
$skipToken?: string; | ||
}, | ||
Response = ArmResponse<BackupEngineBaseResourceList> | ||
>; | ||
} | ||
|
||
@@doc(BackupEngineBaseResource.name, "Name of the backup management server."); |
191 changes: 191 additions & 0 deletions
191
...ation/recoveryservicesbackup/RecoveryServices.Management/BackupResourceConfigResource.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,191 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@typespec/openapi"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
using TypeSpec.OpenAPI; | ||
|
||
namespace Microsoft.RecoveryServices; | ||
/** | ||
* The resource storage details. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" | ||
@singleton("vaultstorageconfig") | ||
@parentResource(VaultResource) | ||
@Azure.ResourceManager.Private.armResourceInternal(BackupResourceConfig) | ||
@Azure.ResourceManager.Legacy.customAzureResource | ||
@Http.Private.includeInapplicableMetadataInPayload(false) | ||
model BackupResourceConfigResource extends Resource { | ||
...ResourceNameParameter< | ||
Resource = BackupResourceConfigResource, | ||
KeyName = "backupstorageconfig", | ||
SegmentName = "backupstorageconfig", | ||
NamePattern = "" | ||
>; | ||
|
||
/** | ||
* BackupResourceConfigResource properties | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" | ||
properties?: BackupResourceConfig; | ||
} | ||
|
||
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility" | ||
@armResourceOperations | ||
interface BackupResourceStorageConfigsNonCRR { | ||
/** | ||
* Fetches resource storage config. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" | ||
@operationId("BackupResourceStorageConfigsNonCRR_Get") | ||
get is ArmResourceRead<BackupResourceConfigResource>; | ||
|
||
/** | ||
* Updates vault storage model type. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" | ||
@operationId("BackupResourceStorageConfigsNonCRR_Update") | ||
update is ArmResourceCreateOrReplaceSync< | ||
BackupResourceConfigResource, | ||
Response = ArmResourceUpdatedResponse<BackupResourceConfigResource> | ||
>; | ||
|
||
/** | ||
* Updates vault storage model type. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" | ||
@patch(#{ implicitOptionality: false }) | ||
@operationId("BackupResourceStorageConfigsNonCRR_patch") | ||
patch is ArmCustomPatchSync< | ||
BackupResourceConfigResource, | ||
PatchModel = BackupResourceConfigResource, | ||
Response = ArmNoContentResponse | ||
>; | ||
|
||
/** | ||
* Prepares source vault for Data Move operation | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility" | ||
@action("prepareDataMove") | ||
@operationId("BMSPrepareDataMove") | ||
bMSPrepareDataMove is ArmResourceActionAsync< | ||
BackupResourceConfigResource, | ||
PrepareDataMoveRequest, | ||
OkResponse | ||
>; | ||
|
||
/** | ||
* Triggers Data Move Operation on target vault | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility" | ||
@action("triggerDataMove") | ||
@operationId("BMSTriggerDataMove") | ||
bMSTriggerDataMove is ArmResourceActionAsync< | ||
BackupResourceConfigResource, | ||
TriggerDataMoveRequest, | ||
OkResponse | ||
>; | ||
} | ||
|
||
@armResourceOperations | ||
interface BackupResourceConfigOperationResultOps | ||
extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
{ | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
...Azure.ResourceManager.Legacy.Provider, | ||
|
||
/** vaults */ | ||
@path @segment("vaults") vaultName: string, | ||
|
||
/** backupStorageConfigName */ | ||
@path | ||
@segment("backupstorageconfig") | ||
backupStorageConfigName: "vaultstorageconfig", | ||
}, | ||
KeysOf<ResourceNameParameter< | ||
Resource = BackupResourceConfigResource, | ||
KeyName = "operationId", | ||
SegmentName = "operationResults", | ||
NamePattern = "" | ||
>> | ||
> {} | ||
|
||
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility" | ||
@armResourceOperations | ||
interface BMSPrepareDataMoveOperationResult { | ||
/** | ||
* Fetches operation status for data move operation on vault | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "For backward compatibility" | ||
@operationId("BMSPrepareDataMoveOperationResult_Get") | ||
get is BackupResourceConfigOperationResultOps.Read< | ||
BackupResourceConfigResource, | ||
Response = ArmResponse<VaultStorageConfigOperationResultResponse> | AcceptedResponse | ||
>; | ||
} | ||
|
||
@armResourceOperations | ||
interface BackupResourceConfigOperationStatusOps | ||
extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
{ | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
...Azure.ResourceManager.Legacy.Provider, | ||
|
||
/** vaults */ | ||
@path @segment("vaults") vaultName: string, | ||
|
||
/** backupStorageConfigName */ | ||
@path | ||
@segment("backupstorageconfig") | ||
backupStorageConfigName: "vaultstorageconfig", | ||
}, | ||
KeysOf<ResourceNameParameter< | ||
Resource = BackupResourceConfigResource, | ||
KeyName = "operationId", | ||
SegmentName = "operationStatus", | ||
NamePattern = "" | ||
>> | ||
> {} | ||
|
||
#suppress "@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation" "For backward compatibility" | ||
@armResourceOperations | ||
interface BackupResourceConfigOperationStatuses { | ||
/** | ||
* Fetches Operation Result for Prepare Data Move | ||
*/ | ||
@get | ||
getOperationStatus is BackupResourceConfigOperationStatusOps.Read< | ||
BackupResourceConfigResource, | ||
Response = ArmResponse<OperationStatus> | ||
>; | ||
} | ||
|
||
@@doc(BackupResourceConfigResource.name, ""); | ||
@@doc(BackupResourceStorageConfigsNonCRR.update::parameters.resource, | ||
"Vault storage config request" | ||
); | ||
@@doc(BackupResourceStorageConfigsNonCRR.patch::parameters.properties, | ||
"Vault storage config request" | ||
); | ||
@@doc(BackupResourceStorageConfigsNonCRR.bMSPrepareDataMove::parameters.body, | ||
"Prepare data move request" | ||
); | ||
@@doc(BackupResourceStorageConfigsNonCRR.bMSTriggerDataMove::parameters.body, | ||
"Trigger data move request" | ||
); |
93 changes: 93 additions & 0 deletions
93
...icesbackup/RecoveryServices.Management/BackupResourceEncryptionConfigExtendedResource.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,93 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
|
||
namespace Microsoft.RecoveryServices; | ||
|
||
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" | ||
@singleton("backupResourceEncryptionConfig") | ||
@parentResource(VaultResource) | ||
@Azure.ResourceManager.Private.armResourceInternal( | ||
BackupResourceEncryptionConfigExtended | ||
) | ||
@Azure.ResourceManager.Legacy.customAzureResource | ||
@Http.Private.includeInapplicableMetadataInPayload(false) | ||
model BackupResourceEncryptionConfigExtendedResource extends Resource { | ||
...ResourceNameParameter< | ||
Resource = BackupResourceEncryptionConfigExtendedResource, | ||
KeyName = "backupEncryptionConfig", | ||
SegmentName = "backupEncryptionConfigs", | ||
NamePattern = "" | ||
>; | ||
|
||
/** | ||
* BackupResourceEncryptionConfigExtendedResource properties | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" | ||
properties?: BackupResourceEncryptionConfigExtended; | ||
} | ||
|
||
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" | ||
@singleton("backupResourceEncryptionConfig") | ||
@parentResource(VaultResource) | ||
@Azure.ResourceManager.Private.armResourceInternal( | ||
BackupResourceEncryptionConfig | ||
) | ||
@Azure.ResourceManager.Legacy.customAzureResource | ||
@Http.Private.includeInapplicableMetadataInPayload(false) | ||
model BackupResourceEncryptionConfigResource extends Resource { | ||
...ResourceNameParameter< | ||
Resource = BackupResourceEncryptionConfigResource, | ||
KeyName = "backupEncryptionConfig", | ||
SegmentName = "backupEncryptionConfigs", | ||
NamePattern = "" | ||
>; | ||
|
||
/** | ||
* BackupResourceEncryptionConfigResource properties | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" | ||
properties?: BackupResourceEncryptionConfig; | ||
} | ||
|
||
#suppress "@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation" "For backward compatibility" | ||
@armResourceOperations | ||
interface BackupResourceEncryptionConfigs { | ||
/** | ||
* Fetches Vault Encryption config. | ||
*/ | ||
get is ArmResourceRead<BackupResourceEncryptionConfigExtendedResource>; | ||
|
||
/** | ||
* Updates Vault encryption config. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "For backward compatibility" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility" | ||
update is ArmResourceCreateOrReplaceSync< | ||
BackupResourceEncryptionConfigResource, | ||
Response = OkResponse | ||
>; | ||
} | ||
|
||
@@doc(BackupResourceEncryptionConfigExtendedResource.name, ""); | ||
@@doc(BackupResourceEncryptionConfigs.update::parameters.resource, | ||
"Vault encryption input config request" | ||
); | ||
|
||
@@doc(BackupResourceEncryptionConfigResource.name, ""); |
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.