Skip to content
Open
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d0ddf99
convert generated and fixed some error
mcgallan Apr 29, 2025
90045ba
generate swagger
mcgallan Apr 29, 2025
a9ac2a0
Merge remote-tracking branch 'upstream/main' into Convert-Servicelinker
mcgallan May 6, 2025
9389cb6
generate diff
mcgallan May 6, 2025
ee2b24e
Merge remote-tracking branch 'upstream/main' into Convert-Servicelinker
mcgallan May 7, 2025
90447bf
Merge remote-tracking branch 'upstream/main' into Convert-Servicelinker
mcgallan May 20, 2025
16439d7
fix
mcgallan May 20, 2025
5d0721d
update
mcgallan May 20, 2025
ca12b7b
update
mcgallan May 20, 2025
4b5dba1
update
mcgallan May 21, 2025
6204228
update
mcgallan May 21, 2025
9c08008
update
mcgallan May 21, 2025
f16e1cc
Merge remote-tracking branch 'upstream/main' into Convert-Servicelinker
mcgallan May 21, 2025
4039c1d
update
mcgallan May 21, 2025
89e683b
Merge branch 'main' into Convert-Servicelinker
mcgallan May 21, 2025
c11983a
update
mcgallan May 21, 2025
f6e832e
Merge branch 'main' into Convert-Servicelinker
mcgallan May 22, 2025
783f394
update
mcgallan May 22, 2025
feed1fc
update
mcgallan May 23, 2025
280ad3e
Merge remote-tracking branch 'upstream/main' into Convert-Servicelinker
mcgallan Jun 24, 2025
8be12aa
update
mcgallan Jun 24, 2025
50d8b4f
update
mcgallan Jun 24, 2025
ee6ad6c
update
mcgallan Jun 26, 2025
eb11fe5
update
mcgallan Jun 26, 2025
e2b99e2
Merge branch 'main' into Convert-Servicelinker
mcgallan Jun 26, 2025
0aadd4e
update
mcgallan Jun 27, 2025
3ed0c78
Revert "update"
mcgallan Jun 27, 2025
dc1af98
Reapply "update"
mcgallan Jun 27, 2025
3fc3584
Merge remote-tracking branch 'upstream/main' into Convert-Servicelinker
mcgallan Jul 3, 2025
e94fc03
update
mcgallan Jul 3, 2025
14d2e8d
update
mcgallan Jul 3, 2025
74a7283
update
mcgallan Jul 3, 2025
d59a7e1
update go config
JiaqiZhang-Dev Jul 8, 2025
72b4deb
java config
XiaofeiCao Jul 9, 2025
423fee2
Merge branch 'main' into Convert-Servicelinker
v-jiaodi Jul 14, 2025
d0c7048
Remove Bodyboot Decorator
melina5656 Jul 15, 2025
f05aabe
resolve breaking
v-jiaodi Jul 17, 2025
47fc363
Merge branch 'main' into Convert-Servicelinker
v-jiaodi Jul 18, 2025
de7befb
go customization
Jul 25, 2025
9c14341
rename duplicate enum
Jul 31, 2025
a9d2931
Merge branch 'main' into Convert-Servicelinker
mcgallan Aug 6, 2025
ffbfe26
Merge branch 'main' into Convert-Servicelinker
mcgallan Aug 12, 2025
ea0ee07
update
mcgallan Aug 12, 2025
a4052c4
fix nextlinkname
mcgallan Aug 12, 2025
83c96cb
Merge branch 'main' into Convert-Servicelinker
mcgallan Aug 13, 2025
dca4e65
removed useDependency
mcgallan Aug 21, 2025
c920b74
Merge branch 'main' into Convert-Servicelinker
mcgallan Aug 21, 2025
5c97657
update docs for resourceUri parameter
mcgallan Aug 22, 2025
e3e66a0
remove suppression
mcgallan Aug 25, 2025
e8756ae
update ExtensionResource in ServiceLinker
mcgallan Aug 28, 2025
92394ac
Merge branch 'main' into Convert-Servicelinker
msyyc Sep 11, 2025
3c38f07
fix flatten
msyyc Sep 11, 2025
0e3900b
Merge branch 'main' into Convert-Servicelinker
mcgallan Sep 15, 2025
793bd2c
downgrade sub id parameter
Oct 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can we use the same casing for all .tsp file names in the project directory?

Copy link
Member

Choose a reason for hiding this comment

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

The same casing you mean "DryRunResource"? We honored what service defined here.

Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
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;

namespace Microsoft.ServiceLinker;
/**
* a dryrun job resource
*/
@subscriptionResource
@parentResource(SubscriptionLocationResource)
model DryrunResource is Azure.ResourceManager.ProxyResource<DryrunProperties> {
...ResourceNameParameter<
Resource = DryrunResource,
KeyName = "dryrunName",
SegmentName = "dryruns",
NamePattern = ""
>;
}

@armResourceOperations
interface DryrunResourceOps
extends Azure.ResourceManager.Legacy.LegacyOperations<
{
...ApiVersionParameter,
...SubscriptionIdParameter,
...ResourceGroupParameter,
...Azure.ResourceManager.Legacy.Provider,
...LocationParameter,
},
KeysOf<ResourceNameParameter<
Resource = DryrunResource,
KeyName = "dryrunName",
SegmentName = "dryruns",
NamePattern = ""
>>
> {}

@armResourceOperations
interface DryrunResources {
/**
* get a dryrun job
*/
getDryrun is DryrunResourceOps.Read<DryrunResource>;

/**
* create a dryrun job to do necessary check before actual creation
*/
createDryrun is DryrunResourceOps.CreateOrUpdateAsync<DryrunResource>;

/**
* update a dryrun job to do necessary check before actual creation
*/
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
updateDryrun is DryrunResourceOps.CustomPatchAsync<
DryrunResource,
PatchModel = DryrunPatch,
Response = ArmResourceUpdatedResponse<DryrunResource> | ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader<FinalResult = DryrunResource>>
>;

/**
* delete a dryrun job
*/
deleteDryrun is DryrunResourceOps.DeleteSync<DryrunResource>;

/**
* list dryrun jobs
*/
listDryrun is DryrunResourceOps.List<
DryrunResource,
Response = ArmResponse<DryrunList>
>;
}

@armResourceOperations
interface LinkersOps
extends Azure.ResourceManager.Legacy.LegacyOperations<
{
...ApiVersionParameter,

/** The fully qualified Azure Resource manager identifier of the resource to be connected. */
@path(#{ allowReserved: true })
resourceUri: string,

...Azure.ResourceManager.Legacy.Provider,
},
KeysOf<ResourceNameParameter<
Resource = DryrunResource,
KeyName = "dryrunName",
SegmentName = "dryruns",
NamePattern = ""
>>
> {}
@armResourceOperations
interface Linkers {
/**
* get a dryrun job
*/
getDryrun is LinkersOps.Read<DryrunResource>;

/**
* create a dryrun job to do necessary check before actual creation
*/
createDryrun is LinkersOps.CreateOrUpdateAsync<DryrunResource>;

/**
* add a dryrun job to do necessary check before actual creation
*/
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
Copy link
Member

Choose a reason for hiding this comment

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

Is this an lro? And if so, how does it perform polling?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, LRO! I didn't get your question actually. How service perform polling? I feel like it's not a question to me.

@patch(#{ implicitOptionality: false })
updateDryrun is LinkersOps.CustomPatchAsync<
DryrunResource,
PatchModel = DryrunPatch,
Response = ArmResourceUpdatedResponse<DryrunResource> | ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader<FinalResult = DryrunResource>>
>;

/**
* delete a dryrun job
*/
deleteDryrun is LinkersOps.DeleteSync<DryrunResource>;

/**
* list dryrun jobs
*/
listDryrun is LinkersOps.List<
DryrunResource,
Response = ArmResponse<DryrunList>
>;
}

@@doc(DryrunResource.name, "The name of dryrun.");
@@doc(DryrunResource.properties, "The properties of the dryrun job.");
@@doc(DryrunResources.createDryrun::parameters.resource, "dryrun resource.");
@@doc(DryrunResources.updateDryrun::parameters.properties, "dryrun resource.");
@@doc(Linkers.createDryrun::parameters.resource, "dryrun resource.");
@@doc(Linkers.updateDryrun::parameters.properties, "dryrun resource.");
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
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;

namespace Microsoft.ServiceLinker;
/**
* Linker of source and target resource
*/
@subscriptionResource
@parentResource(SubscriptionLocationResource)
model LinkerResource
is Azure.ResourceManager.ProxyResource<LinkerProperties, false> {
...ResourceNameParameter<
Resource = LinkerResource,
KeyName = "connectorName",
SegmentName = "connectors",
NamePattern = ""
>;
}

@armResourceOperations
interface LinkerResourceOps
extends Azure.ResourceManager.Legacy.LegacyOperations<
{
...ApiVersionParameter,
...SubscriptionIdParameter,
...ResourceGroupParameter,
...Azure.ResourceManager.Legacy.Provider,
...LocationParameter,
},
KeysOf<ResourceNameParameter<
Resource = LinkerResource,
KeyName = "connectorName",
SegmentName = "connectors",
NamePattern = ""
>>
> {}

@armResourceOperations
interface LinkerResources {
/**
* Returns Connector resource for a given name.
*/
get is LinkerResourceOps.Read<LinkerResource>;

/**
* Create or update Connector resource.
*/
createOrUpdate is LinkerResourceOps.CreateOrUpdateAsync<LinkerResource>;
/**
* Operation to update an existing Connector.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
update is LinkerResourceOps.CustomPatchAsync<
LinkerResource,
PatchModel = LinkerPatch,
Response = ArmResponse<LinkerResource> | (ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader<FinalResult = LinkerResource>> & {
@bodyRoot
_: LinkerResource;
})
>;

/**
* Delete a Connector.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
Copy link
Member

Choose a reason for hiding this comment

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

Why is the location header missing? What is the polling method for this operation? Will downstream client libraries know how to perform polling with this spec?

Copy link
Member

Choose a reason for hiding this comment

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

I've no ideas what the polling operation is. I just honored what swagger defined. There is no place in swagger could identify a polling operation.

#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
Copy link
Member

Choose a reason for hiding this comment

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

Why are we getting this linter warning with this template? I dont see it modifying the response code. If this is non-standard behavior that is purposefully added for legacy reasons, seems like the suppression should be on the template itself instead of making every user of this template add suppressions for it

Copy link
Member

Choose a reason for hiding this comment

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

It does. The Response is already customzied.

delete is LinkerResourceOps.DeleteWithoutOkAsync<
LinkerResource,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse<ArmAsyncOperationHeader &
Azure.Core.Foundations.RetryAfterHeader> | ArmDeletedNoContentResponse
>;

/**
* Returns list of connector which connects to the resource, which supports to config the target service during the resource provision.
*/
list is LinkerResourceOps.List<
LinkerResource,
Response = ArmResponse<ResourceList>
>;

/**
* Validate a Connector.
*/
validate is LinkerResourceOps.ActionAsync<
LinkerResource,
void,
ValidateOperationResult
>;

/**
* Generate configurations for a Connector.
*/
generateConfigurations is LinkerResourceOps.ActionSync<
LinkerResource,
ConfigurationInfo,
ArmResponse<ConfigurationResult>,
OptionalRequestBody = true
>;
}
@armResourceOperations
interface LinkerOps
extends Azure.ResourceManager.Legacy.LegacyOperations<
{
...ApiVersionParameter,

/** The fully qualified Azure Resource manager identifier of the resource to be connected. */
@path(#{ allowReserved: true })
resourceUri: string,

...Azure.ResourceManager.Legacy.Provider,
},
KeysOf<ResourceNameParameter<
Resource = LinkerResource,
KeyName = "linkerName",
SegmentName = "linkers",
NamePattern = ""
>>
> {}

@armResourceOperations
interface Linker {
/**
* Returns Linker resource for a given name.
*/
get is LinkerOps.Read<LinkerResource>;

/**
* Create or update Linker resource.
*/
createOrUpdate is LinkerOps.CreateOrUpdateAsync<LinkerResource>;

/**
* Operation to update an existing Linker.
*/
@patch(#{ implicitOptionality: false })
update is LinkerOps.CustomPatchAsync<
LinkerResource,
PatchModel = LinkerPatch,
Response = ArmResponse<LinkerResource> | ArmResourceCreatedResponse<
LinkerResource,
LroHeaders = ArmAsyncOperationHeader<FinalResult = LinkerResource>
>
>;

/**
* Delete a Linker.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#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 LinkerOps.DeleteWithoutOkAsync<
LinkerResource,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse<ArmAsyncOperationHeader &
Azure.Core.Foundations.RetryAfterHeader> | ArmDeletedNoContentResponse
>;

/**
* Returns list of Linkers which connects to the resource. which supports to config both application and target service during the resource provision.
*/
@segment("linkers")
list is LinkerOps.List<LinkerResource, Response = ArmResponse<ResourceList>>;

/**
* Validate a Linker.
*/
@action("validateLinker")
validate is LinkerOps.ActionAsync<
LinkerResource,
void,
ValidateOperationResult
>;

/**
* list source configurations for a Linker.
*/
listConfigurations is LinkerOps.ActionSync<
LinkerResource,
void,
ArmResponse<ConfigurationResult>
>;

/**
* Generate configurations for a Linker.
*/
generateConfigurations is LinkerOps.ActionSync<
LinkerResource,
ConfigurationInfo,
ArmResponse<ConfigurationResult>,
OptionalRequestBody = true
>;
}

@@doc(LinkerResource.name, "The name of resource.");
@@doc(LinkerResource.properties, "The properties of the Linker.");
@@doc(LinkerResources.createOrUpdate::parameters.resource,
"Connector details."
);
@@doc(LinkerResources.update::parameters.properties, "Connector details.");
@@doc(Linker.createOrUpdate::parameters.resource, "Linker details.");
@@doc(Linker.update::parameters.properties, "Linker details.");
@@doc(LinkerResources.generateConfigurations::parameters.body,
"Connection Info, including format, secret store, etc"
);
@@doc(Linker.generateConfigurations::parameters.body,
"Connection Info, including format, secret store, etc"
);
Loading
Loading