Skip to content

Commit

Permalink
tsp format (#25111)
Browse files Browse the repository at this point in the history
  • Loading branch information
serbrech authored Aug 2, 2023
1 parent cf7c881 commit ffc2a73
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
11 changes: 8 additions & 3 deletions specification/containerservice/Fleet.Management/fleet.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ model Fleet is TrackedResource<FleetProperties> {
@segment("fleets")
@visibility("create", "read")
name: string;

...EntityTag;

#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "https://github.com/Azure/typespec-azure/issues/2840"
Expand Down Expand Up @@ -95,11 +96,11 @@ model APIServerAccessProfile {

@visibility("read", "create")
@doc("Whether to enable apiserver vnet integration for the Fleet hub or not.")
enableVnetIntegration?: boolean;
enableVnetIntegration?: boolean;

@visibility("read", "create")
@doc("The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new Fleet with BYO vnet.")
subnetId?: SubnetResourceId;
subnetId?: SubnetResourceId;
}

@doc("Agent profile for the Fleet hub.")
Expand All @@ -113,10 +114,13 @@ model AgentProfile {
@doc("The provisioning state of the last accepted operation.")
enum FleetProvisioningState {
...ResourceProvisioningState,

@doc("The provisioning state of a fleet being created.")
Creating,

@doc("The provisioning state of a fleet being updated.")
Updating,

@doc("The provisioning state of a fleet being deleted.")
Deleting,
}
Expand All @@ -125,6 +129,7 @@ enum FleetProvisioningState {
model FleetPatch {
@doc("Resource tags.")
tags?: Record<string>;

// adding a response header in the model currently impacts the model used in the List result model.
// omitting it for now as response headers do not impact SDK generation.
// ...EtagResponseEnvelope;
Expand Down Expand Up @@ -159,8 +164,8 @@ interface Fleets {
@doc("Gets a Fleet.")
get is ArmResourceRead<Fleet>;

@doc("Creates or updates a Fleet.")
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "changing the operation-id on an existing operation is an SDK breaking change"
@doc("Creates or updates a Fleet.")
@operationId("Fleets_CreateOrUpdate")
create is ArmResourceCreateOrUpdateAsync<
Fleet,
Expand Down
11 changes: 9 additions & 2 deletions specification/containerservice/Fleet.Management/fleetmember.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ model FleetMember is ProxyResource<FleetMemberProperties> {
@segment("members")
@visibility("create", "read")
name: string;

...EntityTag;
}

Expand Down Expand Up @@ -60,10 +61,13 @@ model FleetMemberProperties {
@doc("The provisioning state of the last accepted operation.")
enum FleetMemberProvisioningState {
...ResourceProvisioningState,

@doc("The provisioning state of a member joining a fleet.")
Joining,

@doc("The provisioning state of a member leaving a fleet.")
Leaving,

@doc("The provisioning state of a member being updated.")
Updating,
}
Expand All @@ -80,8 +84,11 @@ interface FleetMembers {
>;

@added(Versions.v2023_03_15_preview)
update is ArmResourcePatchAsync<FleetMember, FleetMemberProperties, BaseParameters<FleetMember> &
IfMatchParameters<FleetMember>>;
update is ArmResourcePatchAsync<
FleetMember,
FleetMemberProperties,
BaseParameters<FleetMember> & IfMatchParameters<FleetMember>
>;

delete is ArmResourceDeleteAsync<
FleetMember,
Expand Down
2 changes: 1 addition & 1 deletion specification/containerservice/Fleet.Management/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ enum Versions {
@doc("Azure Kubernetes Fleet Manager api version 2023-06-15-preview.")
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
v2023_06_15_preview: "2023-06-15-preview"
v2023_06_15_preview: "2023-06-15-preview",
}
6 changes: 6 additions & 0 deletions specification/containerservice/Fleet.Management/updaterun.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ model UpdateRun is ProxyResource<UpdateRunProperties> {
@path
@visibility("create", "read")
name: string;

...EntityTag;
}

Expand Down Expand Up @@ -161,18 +162,23 @@ enum ManagedClusterUpgradeType {
enum UpdateState {
@doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has not been started.")
NotStarted,

@doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is running.")
Running,

@doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is being stopped.")
Stopping,

@doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has stopped.")
Stopped,

@added(Versions.v2023_06_15_preview)
@doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has been skipped.")
Skipped,

@doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed.")
Failed,

@doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has completed.")
Completed,
}
Expand Down

0 comments on commit ffc2a73

Please sign in to comment.