Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8e13b1c
initial convert
XiaofeiCao Oct 23, 2025
5e729cb
single swagger file compare
XiaofeiCao Oct 23, 2025
f50e1ad
fix routes
XiaofeiCao Oct 23, 2025
0b7d6df
fix managementgroups paths
XiaofeiCao Oct 23, 2025
68c9c57
fix
XiaofeiCao Oct 23, 2025
f94bf87
format
XiaofeiCao Oct 23, 2025
6ca72eb
sdk configs
XiaofeiCao Oct 23, 2025
d860ff3
Revert "single swagger file compare"
XiaofeiCao Oct 23, 2025
e8bdb74
prettier
XiaofeiCao Oct 23, 2025
cdb693f
service-dir
XiaofeiCao Oct 23, 2025
8fe0d75
fix cache-control and x-nullable
XiaofeiCao Oct 23, 2025
f9d5665
config
XiaofeiCao Oct 23, 2025
c6962c7
Merge branch 'main' into migrate/managementgroups
v-jiaodi Nov 12, 2025
cfead55
remove operation id
XiaofeiCao Nov 13, 2025
d70ecde
fix x-nullable
XiaofeiCao Nov 13, 2025
997c275
x-ms-parameter-location for subscriptionId
XiaofeiCao Nov 13, 2025
f7556bc
add code
jliusan Nov 24, 2025
b927d94
add code
jliusan Nov 24, 2025
143811f
Add client customization for ManagementGroupsAPI
msyyc Nov 25, 2025
526c295
Rename client to ManagementGroupsMgmtClient
msyyc Nov 25, 2025
4e6a339
Revert "x-ms-parameter-location for subscriptionId"
XiaofeiCao Nov 24, 2025
df79d9f
make subscriptionId method level parameter
XiaofeiCao Nov 25, 2025
00b0015
add clientlocation
jliusan Nov 26, 2025
b6d242a
fix merge
jliusan Nov 26, 2025
809ed22
test config
jliusan Nov 26, 2025
cb874a8
test config
jliusan Nov 26, 2025
150cdee
update config
jliusan Nov 28, 2025
fe62140
change code place
jliusan Dec 2, 2025
4675e37
change code place
jliusan Dec 2, 2025
9ec5522
remove code
jliusan Dec 2, 2025
777e250
add usage for input model
v-jiaodi Dec 2, 2025
2f37c3c
update client name
v-jiaodi Dec 2, 2025
5c01ab4
Merge branch 'Azure:main' into migrate/managementgroups
XiaofeiCao Dec 9, 2025
9efc7ad
fix pageable
XiaofeiCao Dec 9, 2025
ef04b8e
Update back-compatible.tsp
v-jiaodi Dec 11, 2025
f30976e
Update flattenProperty call for EntityInfo
v-jiaodi Dec 11, 2025
46f450d
fix format and final state schema
XiaofeiCao Dec 12, 2025
d3b4188
Merge branch 'main' into migrate/managementgroups
pshao25 Dec 12, 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
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";
import "./ManagementGroup.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;

namespace Microsoft.Management;
/**
* Settings defined at the Management Group scope.
*/
@singleton("default")
@parentResource(ManagementGroup)
model HierarchySettings
is Azure.ResourceManager.ProxyResource<HierarchySettingsProperties> {
...ResourceNameParameter<
Resource = HierarchySettings,
KeyName = "setting",
SegmentName = "settings",
NamePattern = ""
>;
}

@armResourceOperations
interface HierarchySettingsOperationGroup {
/**
* Gets the hierarchy settings defined at the Management Group level. Settings can only be set on the root Management Group of the hierarchy.
*
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
get is Extension.Read<Extension.Tenant, HierarchySettings>;

/**
* Creates or updates the hierarchy settings defined at the Management Group level.
*
*/
#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"
createOrUpdate is Azure.ResourceManager.Legacy.Extension.CreateOrReplaceSync<
Extension.Tenant,
HierarchySettings,
Request = CreateOrUpdateSettingsRequest,
Response = ArmResourceUpdatedResponse<HierarchySettings>
>;

/**
* Updates the hierarchy settings defined at the Management Group level.
*
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@patch(#{ implicitOptionality: false })
update is Extension.CustomPatchSync<
Extension.Tenant,
HierarchySettings,
PatchModel = CreateOrUpdateSettingsRequest
>;

/**
* Deletes the hierarchy settings defined at the Management Group level.
*
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
delete is Extension.DeleteSync<
Extension.Tenant,
HierarchySettings,
Response = ArmDeletedResponse
>;
}

@@doc(HierarchySettings.name, "");
@@doc(HierarchySettings.properties,
"The generic properties of hierarchy settings."
);
@@doc(HierarchySettingsOperationGroup.createOrUpdate::parameters.resource,
"Tenant level settings request parameter."
);
@@doc(HierarchySettingsOperationGroup.update::parameters.properties,
"Tenant level settings request parameter."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
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.Management;
/**
* The management group details.
*/
model ManagementGroup
is Azure.ResourceManager.ProxyResource<ManagementGroupProperties> {
...ResourceNameParameter<
Resource = ManagementGroup,
KeyName = "groupId",
SegmentName = "managementGroups",
NamePattern = ""
>;
}

@armResourceOperations
interface ManagementGroups {
/**
* Get the details of the management group.
*
*/
get is Extension.Read<
Extension.Tenant,
ManagementGroup,
Parameters = {
/**
* The $expand=children query string parameter allows clients to request inclusion of children in the response payload. $expand=path includes the path from the root group to the current group. $expand=ancestors includes the ancestor Ids of the current group.
*/
@query("$expand")
$expand?: ManagementGroupExpandType;

/**
* The $recurse=true query string parameter allows clients to request inclusion of entire hierarchy in the response payload. Note that $expand=children must be passed up if $recurse is set to true.
*/
@query("$recurse")
$recurse?: boolean;

/**
* A filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType ne Subscription')
*/
@query("$filter")
$filter?: string;

/**
* Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility"
@header("Cache-Control")
`Cache-Control`?: string = "no-cache";
}
>;

/**
* Create or update a management group.
* If a management group is already created and a subsequent create request is issued with different properties, the management group properties will be updated.
*
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "For backward compatibility"
@Azure.Core.useFinalStateVia("azure-async-operation")
createOrUpdate is Azure.ResourceManager.Legacy.Extension.CreateOrReplaceAsync<
Extension.Tenant,
ManagementGroup,
Request = CreateManagementGroupRequest,
Parameters = {
/**
* Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility"
@header("Cache-Control")
`Cache-Control`?: string = "no-cache";
},
Response = ArmResourceUpdatedResponse<ManagementGroup> | (ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = ManagementGroup>> & {
@bodyRoot
_: AzureAsyncOperationResults;
})
>;

/**
* Update a management group.
*
*/
#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-patch" "For backward compatibility"
@patch(#{ implicitOptionality: false })
update is Extension.CustomPatchSync<
Extension.Tenant,
ManagementGroup,
PatchModel = PatchManagementGroupRequest,
Parameters = {
/**
* Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility"
@header("Cache-Control")
`Cache-Control`?: string = "no-cache";
}
>;

/**
* Delete management group.
* If a management group contains child resources, the request will fail.
*
*/
#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"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
@Azure.Core.useFinalStateVia("azure-async-operation")
delete is Extension.DeleteWithoutOkAsync<
Extension.Tenant,
ManagementGroup,
Parameters = {
/**
* Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility"
@header("Cache-Control")
`Cache-Control`?: string = "no-cache";
},
Response = (ArmDeleteAcceptedLroResponse<ArmCombinedLroHeaders &
Azure.Core.Foundations.RetryAfterHeader> & {
@bodyRoot
_: AzureAsyncOperationResults;
}) | ArmDeletedNoContentResponse
>;

/**
* List all entities that descend from a management group.
*
*/
@list
@get
@action("descendants")
getDescendants is Extension.ActionSync<
Extension.Tenant,
ManagementGroup,
void,
ArmResponse<DescendantListResult>,
Parameters = {
/**
* Page continuation token is only used if a previous operation returned a partial result.
* If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.
*
*/
@query("$skiptoken")
$skiptoken?: string;

/**
* Number of elements to return when retrieving results. Passing this in will override $skipToken.
*/
@query("$top")
$top?: int32;
}
>;

/**
* Gets all the hierarchy settings defined at the Management Group level. Settings can only be set on the root Management Group of the hierarchy.
*
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@get
@action("settings")
list is Extension.ActionSync<
Extension.Tenant,
ManagementGroup,
void,
ArmResponse<HierarchySettingsList>
>;
}

@@doc(ManagementGroup.name, "Management Group ID.");
@@doc(ManagementGroup.properties,
"The generic properties of a management group."
);
@@doc(ManagementGroups.createOrUpdate::parameters.resource,
"Management group creation parameters."
);
@@doc(ManagementGroups.update::parameters.properties,
"Management group patch parameters."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/rest";
import "./models.tsp";
import "./ManagementGroup.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;

namespace Microsoft.Management;
/**
* The details of subscription under management group.
*/
@parentResource(ManagementGroup)
model SubscriptionUnderManagementGroup
is Azure.ResourceManager.ProxyResource<SubscriptionUnderManagementGroupProperties> {
...ResourceNameParameter<
Resource = SubscriptionUnderManagementGroup,
KeyName = "subscriptionId",
SegmentName = "subscriptions",
NamePattern = ""
>;
}

@armResourceOperations
interface SubscriptionUnderManagementGroups {
/**
* Retrieves details about given subscription which is associated with the management group.
*
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
getSubscription is Extension.Read<
Extension.Tenant,
SubscriptionUnderManagementGroup,
Parameters = {
/**
* Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility"
@header("Cache-Control")
`Cache-Control`?: string = "no-cache";
}
>;

/**
* Associates existing subscription with the management group.
*
*/
#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"
create is Azure.ResourceManager.Legacy.Extension.CreateOrReplaceSync<
Extension.Tenant,
SubscriptionUnderManagementGroup,
Request = void,
Parameters = {
/**
* Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility"
@header("Cache-Control")
`Cache-Control`?: string = "no-cache";
},
Response = ArmResourceUpdatedResponse<SubscriptionUnderManagementGroup>
>;

/**
* De-associates subscription from the management group.
*
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
delete is Extension.DeleteSync<
Extension.Tenant,
SubscriptionUnderManagementGroup,
Parameters = {
/**
* Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "For backward compatibility"
@header("Cache-Control")
`Cache-Control`?: string = "no-cache";
}
>;

/**
* Retrieves details about all subscriptions which are associated with the management group.
*
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
getSubscriptionsUnderManagementGroup is Extension.ListByTarget<
Extension.Tenant,
SubscriptionUnderManagementGroup,
Parameters = {
/**
* Page continuation token is only used if a previous operation returned a partial result.
* If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.
*
*/
@query("$skiptoken")
$skiptoken?: string;
},
Response = ArmResponse<ListSubscriptionUnderManagementGroup>
>;
}

@@doc(SubscriptionUnderManagementGroup.name, "Subscription ID.");
@@doc(SubscriptionUnderManagementGroup.properties,
"The generic properties of subscription under a management group."
);
Loading
Loading