-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[TSP Migration][dns] TypeSpec migrated from swagger #34680
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
Open
melina5656
wants to merge
25
commits into
main
Choose a base branch
from
convert/dns
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
cae50f1
The first version of TSP
melina5656 b4922d5
Merge branch 'main' into convert/dns
melina5656 facda86
Merge branch 'main' into convert/dns
melina5656 1726c5b
Fix diff and errors
melina5656 bc2d808
Update tspconfig.yaml
melina5656 6f11291
upddate
a60d0f1
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
55228cc
update
melina5656 ba73270
java config
XiaofeiCao 6372a89
java config
XiaofeiCao 4e31ba2
update
melina5656 178fb53
Merge branch 'main' into convert/dns
melina5656 86dabd3
Delete conditionalClientFlatten
melina5656 3bf5eae
update
mcgallan 11f79ad
update
mcgallan df2da67
update
mcgallan 7c82a94
Delete CustomLegacyOperation
melina5656 b5f8fd0
update
mcgallan 08f9c50
update
melina5656 919b56c
Merge remote-tracking branch 'upstream/main' into convert/dns
mcgallan 08943ab
update
mcgallan df1f18d
Merge remote-tracking branch 'upstream/main' into convert/dns
mcgallan 4bf9e67
update
mcgallan 0e183aa
fix tsv
XiaofeiCao 57fc603
update
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
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,92 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@typespec/openapi"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
import "./Zone.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
using TypeSpec.OpenAPI; | ||
|
||
namespace Microsoft.Network; | ||
/** | ||
* Represents the DNSSEC configuration. | ||
*/ | ||
@singleton("default") | ||
@parentResource(Zone) | ||
model DnssecConfig is Azure.ResourceManager.ProxyResource<DnssecProperties> { | ||
...ResourceNameParameter< | ||
Resource = DnssecConfig, | ||
KeyName = "dnssecConfig", | ||
SegmentName = "dnssecConfigs", | ||
NamePattern = "" | ||
>; | ||
|
||
/** | ||
* The etag of the DNSSEC configuration. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
etag?: string; | ||
} | ||
|
||
@armResourceOperations | ||
interface DnssecConfigs { | ||
/** | ||
* Gets the DNSSEC configuration. | ||
*/ | ||
get is ArmResourceRead<DnssecConfig, Error = CloudError>; | ||
|
||
// FIXME: (ArmResourceCreateOrReplace): ArmResourceCreateOrReplaceAsync/ArmResourceCreateOrReplaceSync should have a body parameter. | ||
/** | ||
* Creates or updates the DNSSEC configuration on a DNS zone. | ||
*/ | ||
createOrUpdate is Azure.ResourceManager.CustomLegacy.CreateOrUpdateWithoutBodyAsync< | ||
DnssecConfig, | ||
Parameters = { | ||
/** | ||
* The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@header("If-Match") | ||
IfMatch?: string; | ||
|
||
/** | ||
* Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing DNSSEC configuration. Other values will be ignored. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@header("If-None-Match") | ||
IfNoneMatch?: string; | ||
}, | ||
LroHeaders = ArmLroLocationHeader & | ||
Azure.Core.Foundations.RetryAfterHeader, | ||
Error = CloudError | ||
>; | ||
|
||
/** | ||
* Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. | ||
*/ | ||
#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< | ||
DnssecConfig, | ||
Parameters = { | ||
/** | ||
* The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@header("If-Match") | ||
IfMatch?: string; | ||
}, | ||
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse, | ||
Error = CloudError | ||
>; | ||
|
||
/** | ||
* Lists the DNSSEC configurations in a DNS zone. | ||
*/ | ||
listByDnsZone is ArmResourceListByParent<DnssecConfig, Error = CloudError>; | ||
} | ||
|
||
@@doc(DnssecConfig.name, ""); | ||
@@doc(DnssecConfig.properties, "The DNSSEC properties."); |
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,244 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@typespec/openapi"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
import "./Zone.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
using TypeSpec.OpenAPI; | ||
using Azure.ResourceManager.Private; | ||
|
||
namespace Microsoft.Network; | ||
/** | ||
* Describes a DNS record set (a collection of DNS records with the same name and type). | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@Azure.ResourceManager.Private.armResourceInternal(RecordSetProperties) | ||
@TypeSpec.Http.Private.includeInapplicableMetadataInPayload(false) | ||
@parentResource(Zone) | ||
model RecordSet extends Foundations.ProxyResource { | ||
...ResourceNameParameter< | ||
Resource = RecordSet, | ||
KeyName = "relativeRecordSetName", | ||
SegmentName = "{recordType}", | ||
NamePattern = "" | ||
>; | ||
|
||
/** | ||
* The etag of the record set. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
etag?: string; | ||
|
||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@Azure.ResourceManager.Private.armResourcePropertiesOptionality(true) | ||
properties?: RecordSetProperties; | ||
} | ||
|
||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
interface RecordSets { | ||
/** | ||
* Gets a record set. | ||
*/ | ||
@get | ||
@armResourceRead(RecordSet) | ||
@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{+relativeRecordSetName}") | ||
get( | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
|
||
/** | ||
* The name of the DNS zone (without a terminating dot). | ||
*/ | ||
@path | ||
zoneName: string, | ||
|
||
/** | ||
* The name of the record set, relative to the name of the zone. | ||
*/ | ||
@path | ||
relativeRecordSetName: string, | ||
|
||
/** | ||
* The type of DNS record in this record set. | ||
*/ | ||
@path | ||
recordType: RecordType, | ||
): ArmResponse<RecordSet> | CloudError; | ||
|
||
/** | ||
* Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). | ||
*/ | ||
@put | ||
@armResourceCreateOrUpdate(RecordSet) | ||
@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{+relativeRecordSetName}") | ||
createOrUpdate( | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
|
||
/** | ||
* The name of the DNS zone (without a terminating dot). | ||
*/ | ||
@path | ||
zoneName: string, | ||
|
||
/** | ||
* The name of the record set, relative to the name of the zone. | ||
*/ | ||
@path | ||
relativeRecordSetName: string, | ||
|
||
/** | ||
* The type of DNS record in this record set. | ||
*/ | ||
@path | ||
recordType: RecordType, | ||
|
||
/** | ||
* The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@header("If-Match") | ||
IfMatch?: string, | ||
|
||
/** | ||
* Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@header("If-None-Match") | ||
IfNoneMatch?: string, | ||
|
||
@doc("Parameters supplied to the CreateOrUpdate operation.") | ||
@bodyRoot | ||
resource: RecordSet, | ||
): ArmResponse<RecordSet> | ArmCreatedResponse<RecordSet> | CloudError; | ||
/** | ||
* Updates a record set within a DNS zone. | ||
*/ | ||
@patch(#{ implicitOptionality: false }) | ||
@armResourceUpdate(RecordSet) | ||
@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{+relativeRecordSetName}") | ||
update( | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
|
||
/** | ||
* The name of the DNS zone (without a terminating dot). | ||
*/ | ||
@path | ||
zoneName: string, | ||
|
||
/** | ||
* The name of the record set, relative to the name of the zone. | ||
*/ | ||
@path | ||
relativeRecordSetName: string, | ||
|
||
/** | ||
* The type of DNS record in this record set. | ||
*/ | ||
@path | ||
recordType: RecordType, | ||
|
||
/** | ||
* The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting concurrent changes. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@header("If-Match") | ||
IfMatch?: string, | ||
|
||
@doc("Parameters supplied to the Update operation.") | ||
@bodyRoot | ||
properties: RecordSet, | ||
): ArmResponse<RecordSet> | CloudError; | ||
/** | ||
* Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). | ||
*/ | ||
@delete | ||
@armResourceDelete(RecordSet) | ||
@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{+relativeRecordSetName}") | ||
delete( | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
|
||
/** | ||
* The name of the DNS zone (without a terminating dot). | ||
*/ | ||
@path | ||
zoneName: string, | ||
|
||
/** | ||
* The name of the record set, relative to the name of the zone. | ||
*/ | ||
@path | ||
relativeRecordSetName: string, | ||
|
||
/** | ||
* The type of DNS record in this record set. | ||
*/ | ||
@path | ||
recordType: RecordType, | ||
|
||
/** | ||
* The etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@header("If-Match") | ||
IfMatch?: string, | ||
): ArmDeletedResponse | ArmDeletedNoContentResponse | CloudError; | ||
/** | ||
* Lists the record sets of a specified type in a DNS zone. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@get | ||
@armResourceList(RecordSet) | ||
@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}") | ||
listByType( | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
|
||
/** | ||
* The name of the DNS zone (without a terminating dot). | ||
*/ | ||
@path | ||
zoneName: string, | ||
|
||
/** | ||
* The type of DNS record in this record set. | ||
*/ | ||
@path | ||
recordType: RecordType, | ||
|
||
/** | ||
* The maximum number of record sets to return. If not specified, returns up to 100 record sets. | ||
*/ | ||
@query("$top") | ||
$top?: int32, | ||
|
||
/** | ||
* The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> | ||
*/ | ||
@query("$recordsetnamesuffix") | ||
$recordsetnamesuffix?: string, | ||
): ArmResponse<ResourceListResult<RecordSet>> | CloudError; | ||
} | ||
|
||
@@doc(RecordSet.name, | ||
"The name of the record set, relative to the name of the zone." | ||
); | ||
@@doc(RecordSet.properties, "The properties of the record set."); | ||
@@doc(RecordSets.createOrUpdate::parameters.resource, | ||
"Parameters supplied to the CreateOrUpdate operation." | ||
); | ||
@@doc(RecordSets.update::parameters.properties, | ||
"Parameters supplied to the Update operation." | ||
); |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go SDK has a breaking change: - Field
DnssecConfig
of structDnssecConfigsClientCreateOrUpdateResponse
has been removedFor this operation, the original swagger has body content, but in typespec, there changed to 'WithoutBody'
