diff --git a/management/server/http/api/openapi.yml b/management/server/http/api/openapi.yml index 30cb19c0c..45887dc2e 100644 --- a/management/server/http/api/openapi.yml +++ b/management/server/http/api/openapi.yml @@ -526,6 +526,43 @@ components: - revoked - auto_groups - usage_limit + CreateSetupKeyRequest: + type: object + properties: + name: + description: Setup Key name + type: string + example: Default key + type: + description: Setup key type, one-off for single time usage and reusable + type: string + example: reusable + expires_in: + description: Expiration time in seconds + type: integer + minimum: 86400 + maximum: 31536000 + example: 86400 + auto_groups: + description: List of group IDs to auto-assign to peers registered with this key + type: array + items: + type: string + example: "ch8i4ug6lnn4g9hqv7m0" + usage_limit: + description: A number of times this key can be used. The value of 0 indicates the unlimited usage. + type: integer + example: 0 + ephemeral: + description: Indicate that the peer will be ephemeral or not + type: boolean + example: true + required: + - name + - type + - expires_in + - auto_groups + - usage_limit PersonalAccessToken: type: object properties: @@ -1806,7 +1843,7 @@ paths: content: 'application/json': schema: - $ref: '#/components/schemas/SetupKeyRequest' + $ref: '#/components/schemas/CreateSetupKeyRequest' responses: '200': description: A Setup Keys Object diff --git a/management/server/http/api/types.gen.go b/management/server/http/api/types.gen.go index f731356ee..77a6c643d 100644 --- a/management/server/http/api/types.gen.go +++ b/management/server/http/api/types.gen.go @@ -254,6 +254,27 @@ type Country struct { // CountryCode 2-letter ISO 3166-1 alpha-2 code that represents the country type CountryCode = string +// CreateSetupKeyRequest defines model for CreateSetupKeyRequest. +type CreateSetupKeyRequest struct { + // AutoGroups List of group IDs to auto-assign to peers registered with this key + AutoGroups []string `json:"auto_groups"` + + // Ephemeral Indicate that the peer will be ephemeral or not + Ephemeral *bool `json:"ephemeral,omitempty"` + + // ExpiresIn Expiration time in seconds + ExpiresIn int `json:"expires_in"` + + // Name Setup Key name + Name string `json:"name"` + + // Type Setup key type, one-off for single time usage and reusable + Type string `json:"type"` + + // UsageLimit A number of times this key can be used. The value of 0 indicates the unlimited usage. + UsageLimit int `json:"usage_limit"` +} + // DNSSettings defines model for DNSSettings. type DNSSettings struct { // DisabledManagementGroups Groups whose DNS management is disabled @@ -1241,7 +1262,7 @@ type PostApiRoutesJSONRequestBody = RouteRequest type PutApiRoutesRouteIdJSONRequestBody = RouteRequest // PostApiSetupKeysJSONRequestBody defines body for PostApiSetupKeys for application/json ContentType. -type PostApiSetupKeysJSONRequestBody = SetupKeyRequest +type PostApiSetupKeysJSONRequestBody = CreateSetupKeyRequest // PutApiSetupKeysKeyIdJSONRequestBody defines body for PutApiSetupKeysKeyId for application/json ContentType. type PutApiSetupKeysKeyIdJSONRequestBody = SetupKeyRequest