mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add organization id to provisioner sdk type (#13883)
* chore: add organization id to provisioner sdk type
This commit is contained in:
Generated
+4
@@ -10612,6 +10612,10 @@ const docTemplate = `{
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"organization_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"provisioners": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
||||
Generated
+4
@@ -9560,6 +9560,10 @@
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"organization_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"provisioners": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
||||
@@ -509,13 +509,14 @@ func Apps(dbApps []database.WorkspaceApp, agent database.WorkspaceAgent, ownerNa
|
||||
|
||||
func ProvisionerDaemon(dbDaemon database.ProvisionerDaemon) codersdk.ProvisionerDaemon {
|
||||
result := codersdk.ProvisionerDaemon{
|
||||
ID: dbDaemon.ID,
|
||||
CreatedAt: dbDaemon.CreatedAt,
|
||||
LastSeenAt: codersdk.NullTime{NullTime: dbDaemon.LastSeenAt},
|
||||
Name: dbDaemon.Name,
|
||||
Tags: dbDaemon.Tags,
|
||||
Version: dbDaemon.Version,
|
||||
APIVersion: dbDaemon.APIVersion,
|
||||
ID: dbDaemon.ID,
|
||||
OrganizationID: dbDaemon.OrganizationID,
|
||||
CreatedAt: dbDaemon.CreatedAt,
|
||||
LastSeenAt: codersdk.NullTime{NullTime: dbDaemon.LastSeenAt},
|
||||
Name: dbDaemon.Name,
|
||||
Tags: dbDaemon.Tags,
|
||||
Version: dbDaemon.Version,
|
||||
APIVersion: dbDaemon.APIVersion,
|
||||
}
|
||||
for _, provisionerType := range dbDaemon.Provisioners {
|
||||
result.Provisioners = append(result.Provisioners, codersdk.ProvisionerType(provisionerType))
|
||||
|
||||
@@ -36,14 +36,15 @@ const (
|
||||
)
|
||||
|
||||
type ProvisionerDaemon struct {
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
LastSeenAt NullTime `json:"last_seen_at,omitempty" format:"date-time"`
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
APIVersion string `json:"api_version"`
|
||||
Provisioners []ProvisionerType `json:"provisioners"`
|
||||
Tags map[string]string `json:"tags"`
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
LastSeenAt NullTime `json:"last_seen_at,omitempty" format:"date-time"`
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
APIVersion string `json:"api_version"`
|
||||
Provisioners []ProvisionerType `json:"provisioners"`
|
||||
Tags map[string]string `json:"tags"`
|
||||
}
|
||||
|
||||
// ProvisionerJobStatus represents the at-time state of a job.
|
||||
|
||||
Generated
+1
@@ -292,6 +292,7 @@ curl -X GET http://coder-server:8080/api/v2/debug/health \
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"last_seen_at": "2019-08-24T14:15:22Z",
|
||||
"name": "string",
|
||||
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
|
||||
"provisioners": ["string"],
|
||||
"tags": {
|
||||
"property1": "string",
|
||||
|
||||
Generated
+2
@@ -1290,6 +1290,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"last_seen_at": "2019-08-24T14:15:22Z",
|
||||
"name": "string",
|
||||
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
|
||||
"provisioners": ["string"],
|
||||
"tags": {
|
||||
"property1": "string",
|
||||
@@ -1318,6 +1319,7 @@ Status Code **200**
|
||||
| `» id` | string(uuid) | false | | |
|
||||
| `» last_seen_at` | string(date-time) | false | | |
|
||||
| `» name` | string | false | | |
|
||||
| `» organization_id` | string(uuid) | false | | |
|
||||
| `» provisioners` | array | false | | |
|
||||
| `» tags` | object | false | | |
|
||||
| `»» [any property]` | string | false | | |
|
||||
|
||||
Generated
+5
@@ -3677,6 +3677,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"last_seen_at": "2019-08-24T14:15:22Z",
|
||||
"name": "string",
|
||||
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
|
||||
"provisioners": ["string"],
|
||||
"tags": {
|
||||
"property1": "string",
|
||||
@@ -3695,6 +3696,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
|
||||
| `id` | string | false | | |
|
||||
| `last_seen_at` | string | false | | |
|
||||
| `name` | string | false | | |
|
||||
| `organization_id` | string | false | | |
|
||||
| `provisioners` | array of string | false | | |
|
||||
| `tags` | object | false | | |
|
||||
| » `[any property]` | string | false | | |
|
||||
@@ -8160,6 +8162,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"last_seen_at": "2019-08-24T14:15:22Z",
|
||||
"name": "string",
|
||||
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
|
||||
"provisioners": ["string"],
|
||||
"tags": {
|
||||
"property1": "string",
|
||||
@@ -8278,6 +8281,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"last_seen_at": "2019-08-24T14:15:22Z",
|
||||
"name": "string",
|
||||
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
|
||||
"provisioners": ["string"],
|
||||
"tags": {
|
||||
"property1": "string",
|
||||
@@ -8331,6 +8335,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"last_seen_at": "2019-08-24T14:15:22Z",
|
||||
"name": "string",
|
||||
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
|
||||
"provisioners": ["string"],
|
||||
"tags": {
|
||||
"property1": "string",
|
||||
|
||||
Generated
+1
@@ -918,6 +918,7 @@ export interface ProvisionerConfig {
|
||||
// From codersdk/provisionerdaemons.go
|
||||
export interface ProvisionerDaemon {
|
||||
readonly id: string;
|
||||
readonly organization_id: string;
|
||||
readonly created_at: string;
|
||||
readonly last_seen_at?: string;
|
||||
readonly name: string;
|
||||
|
||||
@@ -365,6 +365,7 @@ export const SuspendedMockUser: TypesGen.User = {
|
||||
export const MockProvisioner: TypesGen.ProvisionerDaemon = {
|
||||
created_at: "2022-05-17T17:39:01.382927298Z",
|
||||
id: "test-provisioner",
|
||||
organization_id: MockOrganization.id,
|
||||
name: "Test Provisioner",
|
||||
provisioners: ["echo"],
|
||||
tags: { scope: "organization" },
|
||||
@@ -375,6 +376,7 @@ export const MockProvisioner: TypesGen.ProvisionerDaemon = {
|
||||
export const MockUserProvisioner: TypesGen.ProvisionerDaemon = {
|
||||
created_at: "2022-05-17T17:39:01.382927298Z",
|
||||
id: "test-user-provisioner",
|
||||
organization_id: MockOrganization.id,
|
||||
name: "Test User Provisioner",
|
||||
provisioners: ["echo"],
|
||||
tags: { scope: "user", owner: "12345678-abcd-1234-abcd-1234567890abcd" },
|
||||
@@ -3221,6 +3223,7 @@ export const MockHealth: TypesGen.HealthcheckReport = {
|
||||
{
|
||||
provisioner_daemon: {
|
||||
id: "e455b582-ac04-4323-9ad6-ab71301fa006",
|
||||
organization_id: MockOrganization.id,
|
||||
created_at: "2024-01-04T15:53:03.21563Z",
|
||||
last_seen_at: "2024-01-04T16:05:03.967551Z",
|
||||
name: "ok",
|
||||
@@ -3241,6 +3244,7 @@ export const MockHealth: TypesGen.HealthcheckReport = {
|
||||
{
|
||||
provisioner_daemon: {
|
||||
id: "00000000-0000-0000-000000000000",
|
||||
organization_id: MockOrganization.id,
|
||||
created_at: "2024-01-04T15:53:03.21563Z",
|
||||
last_seen_at: "2024-01-04T16:05:03.967551Z",
|
||||
name: "user-scoped",
|
||||
@@ -3261,6 +3265,7 @@ export const MockHealth: TypesGen.HealthcheckReport = {
|
||||
{
|
||||
provisioner_daemon: {
|
||||
id: "e455b582-ac04-4323-9ad6-ab71301fa006",
|
||||
organization_id: MockOrganization.id,
|
||||
created_at: "2024-01-04T15:53:03.21563Z",
|
||||
last_seen_at: "2024-01-04T16:05:03.967551Z",
|
||||
name: "unhappy",
|
||||
@@ -3416,6 +3421,7 @@ export const DeploymentHealthUnhealthy: TypesGen.HealthcheckReport = {
|
||||
{
|
||||
provisioner_daemon: {
|
||||
id: "e455b582-ac04-4323-9ad6-ab71301fa006",
|
||||
organization_id: MockOrganization.id,
|
||||
created_at: "2024-01-04T15:53:03.21563Z",
|
||||
last_seen_at: "2024-01-04T16:05:03.967551Z",
|
||||
name: "vvuurrkk-2",
|
||||
|
||||
Reference in New Issue
Block a user