You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "rimashah25 (via GitHub)" <gi...@apache.org> on 2023/03/20 21:00:35 UTC

[GitHub] [trafficcontrol] rimashah25 commented on a diff in pull request #7407: Added ASN details for TPV2

rimashah25 commented on code in PR #7407:
URL: https://github.com/apache/trafficcontrol/pull/7407#discussion_r1142672386


##########
experimental/traffic-portal/src/app/api/cache-group.service.ts:
##########
@@ -428,13 +429,34 @@ export class CacheGroupService extends APIService {
 	}
 
 	/**
-	 * Deletes an existing asn.
+	 * Replaces the current definition of a ASN with the one given.
 	 *
-	 * @param asnOrId Id of the asn to delete.
-	 * @returns The deleted asn.
+	 * @param asn The new ASN.
+	 * @returns The updated ASN.
 	 */
-	public async deleteASN(asnOrId: number | ResponseASN): Promise<void> {
-		const id = typeof(asnOrId) === "number" ? asnOrId : asnOrId.id;
+	public async updateASN(asn: ResponseASN): Promise<ResponseASN> {
+		const path = `asns/${asn.id}`;
+		return this.put<ResponseASN>(path, asn).toPromise();
+	}
+
+	/**
+	 * Creates a new ASN.
+	 *
+	 * @param asn The ASN to create.
+	 * @returns The created ASN.
+	 */
+	public async createASN(asn: RequestASN): Promise<ResponseASN> {
+		return this.post<ResponseASN>("asns", asn).toPromise();
+	}
+
+	/**
+	 * Deletes an existing ASN.
+	 *
+	 * @param asnID ID of the ASN to delete.

Review Comment:
   it is the ID of the ASN to be deleted.. I am not sure what would you like me to change?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org