You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2023/01/25 15:32:06 UTC

[trafficcontrol-trafficops-types] 01/10: Add CDN Locks

This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch 4.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol-trafficops-types.git

commit d2a7918c763450179f273d5b57ae496a34b15dd6
Author: ocket8888 <oc...@apache.org>
AuthorDate: Wed Nov 23 18:40:44 2022 -0700

    Add CDN Locks
---
 src/cdn.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/src/cdn.ts b/src/cdn.ts
index 1ef9204..14595a3 100644
--- a/src/cdn.ts
+++ b/src/cdn.ts
@@ -53,3 +53,51 @@ export interface CDNDomain {
 	profileName: string;
 	profileDescription: string;
 }
+
+/**
+ * Represents a CDN Lock as returned by the Traffic Ops API in responses.
+ */
+export interface ResponseCDNLock {
+	/** The username for which the lock exists. */
+	readonly userName: string;
+	/** The name of the CDN for which the lock exists. */
+	readonly cdn: string;
+	/**
+	 * The message or reason that the user specified while acquiring the lock.
+	 */
+	readonly message: string | null;
+	/** Whether or not this is a soft (shared) lock. */
+	readonly soft: boolean;
+	/**
+	 * An array of the usernames that the creator of the lock has shared their
+	 * lock with.
+	 */
+	readonly sharedUserNames: readonly string[] | null;
+	/** Time that this lock was last updated(created). */
+	readonly lastUpdated: Date;
+}
+
+/**
+ * Represents a CDN Lock as required by Traffic Ops in requests.
+ */
+export interface RequestCDNLock {
+	/** The name of the CDN for which the lock exists. */
+	cdn: string;
+	/**
+	 * The message or reason that the user specified while acquiring the lock.
+	 */
+	message?: string | null | undefined;
+	/** Whether or not this is a soft (shared) lock. */
+	soft: boolean;
+	/**
+	 * An array of the usernames that the creator of the lock has shared their
+	 * lock with.
+	 */
+	sharedUserNames?: string[] | null | undefined;
+}
+
+/**
+ * Represents a lock on a CDN that prevents other uses from making changes to
+ * resources scoped within it.
+ */
+export type CDNLock = RequestCDNLock | ResponseCDNLock;