Skip to content

Commit

Permalink
Change transport policy delete endpoint to match with create (#2481)
Browse files Browse the repository at this point in the history
Signed-off-by: rajeshal <[email protected]>
Co-authored-by: rajeshal <[email protected]>
  • Loading branch information
rajeshal and rajeshal authored Jan 10, 2024
1 parent 8724b08 commit b429138
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion clients/go/msd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ func (client MSDClient) DeleteTransportPolicy(domainName DomainName, serviceName
headers := map[string]string{
"Y-Audit-Ref": auditRef,
}
url := client.URL + "/domain/" + fmt.Sprint(domainName) + "/service/" + fmt.Sprint(serviceName) + "/" + fmt.Sprint(id)
url := client.URL + "/domain/" + fmt.Sprint(domainName) + "/service/" + fmt.Sprint(serviceName) + "/transportpolicy/" + fmt.Sprint(id)
resp, err := client.httpDelete(url, headers)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions clients/go/msd/msd_schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public TransportPolicyRules getTransportPolicyRulesByService(String domainName,
}

public TransportPolicyRules deleteTransportPolicy(String domainName, String serviceName, Long id, String auditRef) throws URISyntaxException, IOException {
UriTemplateBuilder uriTemplateBuilder = new UriTemplateBuilder(baseUrl, "/domain/{domainName}/service/{serviceName}/{id}")
UriTemplateBuilder uriTemplateBuilder = new UriTemplateBuilder(baseUrl, "/domain/{domainName}/service/{serviceName}/transportpolicy/{id}")
.resolveTemplate("domainName", domainName)
.resolveTemplate("serviceName", serviceName)
.resolveTemplate("id", id);
Expand Down
4 changes: 2 additions & 2 deletions core/msd/src/main/java/com/yahoo/athenz/msd/MSDSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ private static Schema build() {
;

sb.resource("TransportPolicyRequest", "PUT", "/domain/{domainName}/service/{serviceName}/transportpolicy")
.comment("API endpoint to create a transport policy for a given domain and service")
.comment("This API endpoint facilitates the creation or update of a transport policy for a specified domain and service. It is designed exclusively for the purpose of creating or updating transport policies, and does not support mixed-case scenarios. Once a transport policy is established, the destination service, protocol, and both source and destination ports become non-editable. To modify any of these fields, it is necessary to create a new policy and delete the old one.")
.name("putTransportPolicy")
.pathParam("domainName", "DomainName", "name of the domain")
.pathParam("serviceName", "EntityName", "Name of the service")
Expand Down Expand Up @@ -677,7 +677,7 @@ private static Schema build() {
.exception("UNAUTHORIZED", "ResourceError", "")
;

sb.resource("TransportPolicyRules", "DELETE", "/domain/{domainName}/service/{serviceName}/{id}")
sb.resource("TransportPolicyRules", "DELETE", "/domain/{domainName}/service/{serviceName}/transportpolicy/{id}")
.comment("API endpoint to delete the transport policy Upon successful completion of this delete request, the server will return NO_CONTENT status code without any data (no object will be returned).")
.name("deleteTransportPolicy")
.pathParam("domainName", "DomainName", "Name of the domain")
Expand Down
5 changes: 3 additions & 2 deletions core/msd/src/main/rdl/TransportPolicyRule.rdli
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ resource TransportPolicyRules GET "/domain/{domainName}/transportpolicies" (name
}
}

// API endpoint to create a transport policy for a given domain and service
// This API endpoint facilitates the creation or update of a transport policy for a specified domain and service. It is designed exclusively for the purpose of creating or updating transport policies, and does not support mixed-case scenarios.
// Once a transport policy is established, the destination service, protocol, and both source and destination ports become non-editable. To modify any of these fields, it is necessary to create a new policy and delete the old one.
resource TransportPolicyRules PUT "/domain/{domainName}/service/{serviceName}/transportpolicy" (name=putTransportPolicy) {
DomainName domainName; //name of the domain
EntityName serviceName; //Name of the service
Expand Down Expand Up @@ -102,7 +103,7 @@ resource TransportPolicyRules GET "/domain/{domainName}/service/{serviceName}/tr
// API endpoint to delete the transport policy
// Upon successful completion of this delete request, the server will return NO_CONTENT status code without any data
// (no object will be returned).
resource TransportPolicyRules DELETE "/domain/{domainName}/service/{serviceName}/{id}" (name=deleteTransportPolicy) {
resource TransportPolicyRules DELETE "/domain/{domainName}/service/{serviceName}/transportpolicy/{id}" (name=deleteTransportPolicy) {
DomainName domainName; // Name of the domain
EntityName serviceName; // Name of the service
Int64 id; // Id of the assertion representing the transport policy
Expand Down

0 comments on commit b429138

Please sign in to comment.