Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -70,24 +70,9 @@ interface Endpoints {
/**
* Update a Traffic Manager endpoint.
*/
@sharedRoute
@removed(Versions.v2024_04_01_preview)
@patch(#{ implicitOptionality: false })
update is EndpointsOps.CustomPatchSync<Endpoint, PatchModel = Endpoint>;

/**
* Update a Traffic Manager endpoint.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "operationId needed to match stable version"
@sharedRoute
@added(Versions.v2024_04_01_preview)
@operationId("Endpoints_Update")
@patch(#{ implicitOptionality: false })
updateV2 is EndpointsOps.CustomPatchSync<
Endpoint,
PatchModel = EndpointUpdate
>;

/**
* Deletes a Traffic Manager endpoint.
*/
Expand All @@ -104,6 +89,3 @@ interface Endpoints {
@@doc(Endpoints.update::parameters.properties,
"The Traffic Manager endpoint parameters supplied to the Update operation."
);
@@doc(Endpoints.updateV2::parameters.properties,
"The Traffic Manager endpoint parameters supplied to the Update operation."
);
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,9 @@ interface Profiles {
/**
* Update a Traffic Manager profile.
*/
@sharedRoute
@removed(Versions.v2024_04_01_preview)
@patch(#{ implicitOptionality: false })
update is ProfileOps.CustomPatchSync<Profile, PatchModel = Profile>;

/**
* Update a Traffic Manager profile.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "operationId needed to match stable version"
@sharedRoute
@added(Versions.v2024_04_01_preview)
@operationId("Profiles_Update")
@patch(#{ implicitOptionality: false })
updateV2 is ProfileOps.CustomPatchSync<Profile, PatchModel = ProfileUpdate>;

/**
* Deletes a Traffic Manager profile.
*/
Expand Down Expand Up @@ -113,6 +101,3 @@ interface Profiles {
@@doc(Profiles.update::parameters.properties,
"The Traffic Manager profile parameters supplied to the Update operation."
);
@@doc(Profiles.updateV2::parameters.properties,
"The Traffic Manager profile parameters supplied to the Update operation."
);
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ using Microsoft.Network;

@@clientName(Endpoints.createOrUpdate::parameters.resource, "parameters");
@@clientName(Endpoints.update::parameters.properties, "parameters");
@@clientName(Endpoints.updateV2::parameters.properties, "parameters");
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility"
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Endpoint.properties);

@@clientName(Profiles.createOrUpdate::parameters.resource, "parameters");
@@clientName(Profiles.update::parameters.properties, "parameters");
@@clientName(Profiles.updateV2::parameters.properties, "parameters");

@@clientName(ProfilesOperationGroup.checkTrafficManagerRelativeDnsNameAvailability::parameters.body,
"parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,131 +739,3 @@ model UserMetricsProperties {
#suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: If this is a value that should be kept private, mark it with the @secret decorator"
key?: string;
}

/**
* Parameters supplied to update a Traffic Manager profile.
*/
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Update model for PATCH operation"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "Update model for PATCH operation"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "Update model for PATCH operation"
@added(Versions.v2024_04_01_preview)
model ProfileUpdate {
/**
* Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
*/
@visibility(Lifecycle.Read)
id?: armResourceIdentifier;

/**
* The name of the resource
*/
@visibility(Lifecycle.Read)
name?: string;

/**
* The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
*/
@visibility(Lifecycle.Read)
type?: string;

...ArmTagsProperty;

/**
* The Azure Region where the resource lives
*/
@visibility(Lifecycle.Read)
location?: string;

/**
* The properties of the Traffic Manager profile.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "x-ms-client-flatten is needed for SDK compatibility"
@extension("x-ms-client-flatten", true)
properties?: ProfilePropertiesUpdate;
}

/**
* Class representing the Traffic Manager profile properties for update operations.
*/
@added(Versions.v2024_04_01_preview)
model ProfilePropertiesUpdate {
/**
* The status of the Traffic Manager profile.
*/
profileStatus?: ProfileStatus;

/**
* The traffic routing method of the Traffic Manager profile.
*/
trafficRoutingMethod?: TrafficRoutingMethod;

/**
* The DNS settings of the Traffic Manager profile.
*/
dnsConfig?: DnsConfig;

/**
* The endpoint monitoring settings of the Traffic Manager profile.
*/
monitorConfig?: MonitorConfig;

/**
* The list of endpoints in the Traffic Manager profile.
*/
endpoints?: EndpointUpdate[];

/**
* Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage profile.
*/
trafficViewEnrollmentStatus?: TrafficViewEnrollmentStatus;

/**
* The list of allowed endpoint record types.
*/
allowedEndpointRecordTypes?: AllowedEndpointRecordType[];

/**
* Maximum number of endpoints to be returned for MultiValue routing type.
*/
maxReturn?: int64;

/**
* When record type is set, a traffic manager profile will allow only endpoints that match this type.
*/
@added(Versions.v2024_04_01_preview)
recordType?: RecordType;
}

/**
* Class representing a Traffic Manager endpoint for update operations.
*/
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Update model for PATCH operation"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "Update model for PATCH operation"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "Update model for PATCH operation"
@added(Versions.v2024_04_01_preview)
model EndpointUpdate {
/**
* Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
*/
@visibility(Lifecycle.Read)
id?: armResourceIdentifier;

/**
* The name of the resource
*/
@visibility(Lifecycle.Read)
name?: string;

/**
* The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
*/
@visibility(Lifecycle.Read)
type?: string;

/**
* The properties of the Traffic Manager endpoint.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "x-ms-client-flatten is needed for SDK compatibility"
@extension("x-ms-client-flatten", true)
properties?: EndpointProperties;
}
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@
"description": "The Traffic Manager profile parameters supplied to the Update operation.",
"required": true,
"schema": {
"$ref": "#/definitions/ProfileUpdate"
"$ref": "#/definitions/Profile"
}
}
],
Expand Down Expand Up @@ -800,7 +800,7 @@
"description": "The Traffic Manager endpoint parameters supplied to the Update operation.",
"required": true,
"schema": {
"$ref": "#/definitions/EndpointUpdate"
"$ref": "#/definitions/Endpoint"
}
}
],
Expand Down Expand Up @@ -1316,33 +1316,6 @@
]
}
},
"EndpointUpdate": {
"type": "object",
"description": "Class representing a Traffic Manager endpoint for update operations.",
"properties": {
"id": {
"type": "string",
"format": "arm-id",
"description": "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}",
"readOnly": true
},
"name": {
"type": "string",
"description": "The name of the resource",
"readOnly": true
},
"type": {
"type": "string",
"description": "The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.",
"readOnly": true
},
"properties": {
"$ref": "#/definitions/EndpointProperties",
"description": "The properties of the Traffic Manager endpoint.",
"x-ms-client-flatten": true
}
}
},
"GeographicHierarchyProperties": {
"type": "object",
"description": "Class representing the properties of the Geographic hierarchy used with the Geographic traffic routing method.",
Expand Down Expand Up @@ -1646,55 +1619,6 @@
}
}
},
"ProfilePropertiesUpdate": {
"type": "object",
"description": "Class representing the Traffic Manager profile properties for update operations.",
"properties": {
"profileStatus": {
"$ref": "#/definitions/ProfileStatus",
"description": "The status of the Traffic Manager profile."
},
"trafficRoutingMethod": {
"$ref": "#/definitions/TrafficRoutingMethod",
"description": "The traffic routing method of the Traffic Manager profile."
},
"dnsConfig": {
"$ref": "#/definitions/DnsConfig",
"description": "The DNS settings of the Traffic Manager profile."
},
"monitorConfig": {
"$ref": "#/definitions/MonitorConfig",
"description": "The endpoint monitoring settings of the Traffic Manager profile."
},
"endpoints": {
"type": "array",
"description": "The list of endpoints in the Traffic Manager profile.",
"items": {
"$ref": "#/definitions/EndpointUpdate"
}
},
"trafficViewEnrollmentStatus": {
"$ref": "#/definitions/TrafficViewEnrollmentStatus",
"description": "Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage profile."
},
"allowedEndpointRecordTypes": {
"type": "array",
"description": "The list of allowed endpoint record types.",
"items": {
"$ref": "#/definitions/AllowedEndpointRecordType"
}
},
"maxReturn": {
"type": "integer",
"format": "int64",
"description": "Maximum number of endpoints to be returned for MultiValue routing type."
},
"recordType": {
"$ref": "#/definitions/RecordType",
"description": "When record type is set, a traffic manager profile will allow only endpoints that match this type."
}
}
},
"ProfileStatus": {
"type": "string",
"description": "The status of the Traffic Manager profile.",
Expand All @@ -1717,45 +1641,6 @@
]
}
},
"ProfileUpdate": {
"type": "object",
"description": "Parameters supplied to update a Traffic Manager profile.",
"properties": {
"id": {
"type": "string",
"format": "arm-id",
"description": "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}",
"readOnly": true
},
"name": {
"type": "string",
"description": "The name of the resource",
"readOnly": true
},
"type": {
"type": "string",
"description": "The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.",
"readOnly": true
},
"tags": {
"type": "object",
"description": "Resource tags.",
"additionalProperties": {
"type": "string"
}
},
"location": {
"type": "string",
"description": "The Azure Region where the resource lives",
"readOnly": true
},
"properties": {
"$ref": "#/definitions/ProfilePropertiesUpdate",
"description": "The properties of the Traffic Manager profile.",
"x-ms-client-flatten": true
}
}
},
"ProxyResource": {
"type": "object",
"description": "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ directive:
reason: This will cause breaking changes in .NET SDK
from: trafficmanager.json
where: $.definitions.UserMetricsModel
- suppress: UnSupportedPatchProperties
reason: Pre-existing issue - legacy resource model includes id, name, type in patch body, this will be taken as a separate WI, as this will cause breaking changes in .NET SDK
from: trafficmanager.json
where:
- $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}"].patch.parameters[4]
- $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}"].patch.parameters[6]
- $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}"].patch.parameters[2]
- $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}"].patch.parameters[4]
```

### Tag: package-preview-2024-04
Expand Down
Loading