From 2878e7c8850f3acd91d4448f099e026b85607d96 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 20 Jun 2023 16:19:39 +1000 Subject: [PATCH 01/37] Initial Cluster resource work --- buildkite/generated.go | 518 ++++++++++++++++++++++++++++++ buildkite/graphql/cluster.graphql | 52 +++ buildkite/resource_cluster.go | 104 ++++++ go.mod | 14 +- go.sum | 131 +------- schema.graphql | 32 +- 6 files changed, 695 insertions(+), 156 deletions(-) create mode 100644 buildkite/graphql/cluster.graphql create mode 100644 buildkite/resource_cluster.go diff --git a/buildkite/generated.go b/buildkite/generated.go index 2789e6ef..9208ac33 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -26,6 +26,84 @@ const ( BuildRetentionPeriodsYears2 BuildRetentionPeriods = "YEARS_2" ) +// Autogenerated input type of ClusterCreate +type ClusterCreateInput struct { + // Autogenerated input type of ClusterCreate + ClientMutationId string `json:"clientMutationId"` + // Autogenerated input type of ClusterCreate + OrganizationId string `json:"organizationId"` + // Autogenerated input type of ClusterCreate + Name string `json:"name"` + // Autogenerated input type of ClusterCreate + Description string `json:"description"` + // Autogenerated input type of ClusterCreate + Emoji string `json:"emoji"` + // Autogenerated input type of ClusterCreate + Color string `json:"color"` +} + +// GetClientMutationId returns ClusterCreateInput.ClientMutationId, and is useful for accessing the field via an interface. +func (v *ClusterCreateInput) GetClientMutationId() string { return v.ClientMutationId } + +// GetOrganizationId returns ClusterCreateInput.OrganizationId, and is useful for accessing the field via an interface. +func (v *ClusterCreateInput) GetOrganizationId() string { return v.OrganizationId } + +// GetName returns ClusterCreateInput.Name, and is useful for accessing the field via an interface. +func (v *ClusterCreateInput) GetName() string { return v.Name } + +// GetDescription returns ClusterCreateInput.Description, and is useful for accessing the field via an interface. +func (v *ClusterCreateInput) GetDescription() string { return v.Description } + +// GetEmoji returns ClusterCreateInput.Emoji, and is useful for accessing the field via an interface. +func (v *ClusterCreateInput) GetEmoji() string { return v.Emoji } + +// GetColor returns ClusterCreateInput.Color, and is useful for accessing the field via an interface. +func (v *ClusterCreateInput) GetColor() string { return v.Color } + +// Autogenerated input type of ClusterUpdate +type ClusterUpdateInput struct { + // Autogenerated input type of ClusterUpdate + ClientMutationId string `json:"clientMutationId"` + // Autogenerated input type of ClusterUpdate + OrganizationId string `json:"organizationId"` + // Autogenerated input type of ClusterUpdate + Id string `json:"id"` + // Autogenerated input type of ClusterUpdate + Name string `json:"name"` + // Autogenerated input type of ClusterUpdate + Description string `json:"description"` + // Autogenerated input type of ClusterUpdate + Emoji string `json:"emoji"` + // Autogenerated input type of ClusterUpdate + Color string `json:"color"` + // Autogenerated input type of ClusterUpdate + DefaultQueueId string `json:"defaultQueueId"` +} + +// GetClientMutationId returns ClusterUpdateInput.ClientMutationId, and is useful for accessing the field via an interface. +func (v *ClusterUpdateInput) GetClientMutationId() string { return v.ClientMutationId } + +// GetOrganizationId returns ClusterUpdateInput.OrganizationId, and is useful for accessing the field via an interface. +func (v *ClusterUpdateInput) GetOrganizationId() string { return v.OrganizationId } + +// GetId returns ClusterUpdateInput.Id, and is useful for accessing the field via an interface. +func (v *ClusterUpdateInput) GetId() string { return v.Id } + +// GetName returns ClusterUpdateInput.Name, and is useful for accessing the field via an interface. +func (v *ClusterUpdateInput) GetName() string { return v.Name } + +// GetDescription returns ClusterUpdateInput.Description, and is useful for accessing the field via an interface. +func (v *ClusterUpdateInput) GetDescription() string { return v.Description } + +// GetEmoji returns ClusterUpdateInput.Emoji, and is useful for accessing the field via an interface. +func (v *ClusterUpdateInput) GetEmoji() string { return v.Emoji } + +// GetColor returns ClusterUpdateInput.Color, and is useful for accessing the field via an interface. +func (v *ClusterUpdateInput) GetColor() string { return v.Color } + +// GetDefaultQueueId returns ClusterUpdateInput.DefaultQueueId, and is useful for accessing the field via an interface. +func (v *ClusterUpdateInput) GetDefaultQueueId() string { return v.DefaultQueueId } + // The roles a user can be within a team type GTeamMemberRole string @@ -262,6 +340,14 @@ func (v *__createAgentTokenInput) GetOrganizationId() string { return v.Organiza // GetDescription returns __createAgentTokenInput.Description, and is useful for accessing the field via an interface. func (v *__createAgentTokenInput) GetDescription() string { return v.Description } +// __createClusterInput is used internally by genqlient +type __createClusterInput struct { + Input ClusterCreateInput `json:"input"` +} + +// GetInput returns __createClusterInput.Input, and is useful for accessing the field via an interface. +func (v *__createClusterInput) GetInput() ClusterCreateInput { return v.Input } + // __getAgentTokenInput is used internally by genqlient type __getAgentTokenInput struct { Slug string `json:"slug"` @@ -270,6 +356,18 @@ type __getAgentTokenInput struct { // GetSlug returns __getAgentTokenInput.Slug, and is useful for accessing the field via an interface. func (v *__getAgentTokenInput) GetSlug() string { return v.Slug } +// __getClusterInput is used internally by genqlient +type __getClusterInput struct { + OrgSlug string `json:"orgSlug"` + Id string `json:"id"` +} + +// GetOrgSlug returns __getClusterInput.OrgSlug, and is useful for accessing the field via an interface. +func (v *__getClusterInput) GetOrgSlug() string { return v.OrgSlug } + +// GetId returns __getClusterInput.Id, and is useful for accessing the field via an interface. +func (v *__getClusterInput) GetId() string { return v.Id } + // __getOrganizationInput is used internally by genqlient type __getOrganizationInput struct { Slug string `json:"slug"` @@ -318,6 +416,14 @@ func (v *__setApiIpAddressesInput) GetOrganizationID() string { return v.Organiz // GetIpAddresses returns __setApiIpAddressesInput.IpAddresses, and is useful for accessing the field via an interface. func (v *__setApiIpAddressesInput) GetIpAddresses() string { return v.IpAddresses } +// __updateClusterInput is used internally by genqlient +type __updateClusterInput struct { + Input ClusterUpdateInput `json:"input"` +} + +// GetInput returns __updateClusterInput.Input, and is useful for accessing the field via an interface. +func (v *__updateClusterInput) GetInput() ClusterUpdateInput { return v.Input } + // __updatePipelineInput is used internally by genqlient type __updatePipelineInput struct { Input PipelineUpdateInput `json:"input"` @@ -394,6 +500,45 @@ func (v *createAgentTokenResponse) GetAgentTokenCreate() createAgentTokenAgentTo return v.AgentTokenCreate } +// createClusterClusterCreateClusterCreatePayload includes the requested fields of the GraphQL type ClusterCreatePayload. +// The GraphQL type's documentation follows. +// +// Autogenerated return type of ClusterCreate. +type createClusterClusterCreateClusterCreatePayload struct { + // A unique identifier for the client performing the mutation. + ClientMutationId string `json:"clientMutationId"` + Cluster createClusterClusterCreateClusterCreatePayloadCluster `json:"cluster"` +} + +// GetClientMutationId returns createClusterClusterCreateClusterCreatePayload.ClientMutationId, and is useful for accessing the field via an interface. +func (v *createClusterClusterCreateClusterCreatePayload) GetClientMutationId() string { + return v.ClientMutationId +} + +// GetCluster returns createClusterClusterCreateClusterCreatePayload.Cluster, and is useful for accessing the field via an interface. +func (v *createClusterClusterCreateClusterCreatePayload) GetCluster() createClusterClusterCreateClusterCreatePayloadCluster { + return v.Cluster +} + +// createClusterClusterCreateClusterCreatePayloadCluster includes the requested fields of the GraphQL type Cluster. +type createClusterClusterCreateClusterCreatePayloadCluster struct { + Id string `json:"id"` +} + +// GetId returns createClusterClusterCreateClusterCreatePayloadCluster.Id, and is useful for accessing the field via an interface. +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetId() string { return v.Id } + +// createClusterResponse is returned by createCluster on success. +type createClusterResponse struct { + // Create a cluster. + ClusterCreate createClusterClusterCreateClusterCreatePayload `json:"clusterCreate"` +} + +// GetClusterCreate returns createClusterResponse.ClusterCreate, and is useful for accessing the field via an interface. +func (v *createClusterResponse) GetClusterCreate() createClusterClusterCreateClusterCreatePayload { + return v.ClusterCreate +} + // getAgentTokenAgentToken includes the requested fields of the GraphQL type AgentToken. // The GraphQL type's documentation follows. // @@ -424,6 +569,215 @@ type getAgentTokenResponse struct { // GetAgentToken returns getAgentTokenResponse.AgentToken, and is useful for accessing the field via an interface. func (v *getAgentTokenResponse) GetAgentToken() getAgentTokenAgentToken { return v.AgentToken } +// getClusterOrganization includes the requested fields of the GraphQL type Organization. +// The GraphQL type's documentation follows. +// +// An organization +type getClusterOrganization struct { + // Return cluster in the Organization by UUID + Cluster getClusterOrganizationCluster `json:"cluster"` +} + +// GetCluster returns getClusterOrganization.Cluster, and is useful for accessing the field via an interface. +func (v *getClusterOrganization) GetCluster() getClusterOrganizationCluster { return v.Cluster } + +// getClusterOrganizationCluster includes the requested fields of the GraphQL type Cluster. +type getClusterOrganizationCluster struct { + // Name of the cluster + Name string `json:"name"` + Id string `json:"id"` + // The public UUID for this cluster + Uuid string `json:"uuid"` + // Description of the cluster + Description string `json:"description"` + // The default queue that agents connecting to the cluster without specifying a queue will accept jobs from + DefaultQueue getClusterOrganizationClusterDefaultQueueClusterQueue `json:"defaultQueue"` + // Returns agent tokens for the Cluster + AgentTokens getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection `json:"agentTokens"` +} + +// GetName returns getClusterOrganizationCluster.Name, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetName() string { return v.Name } + +// GetId returns getClusterOrganizationCluster.Id, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetId() string { return v.Id } + +// GetUuid returns getClusterOrganizationCluster.Uuid, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetUuid() string { return v.Uuid } + +// GetDescription returns getClusterOrganizationCluster.Description, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetDescription() string { return v.Description } + +// GetDefaultQueue returns getClusterOrganizationCluster.DefaultQueue, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetDefaultQueue() getClusterOrganizationClusterDefaultQueueClusterQueue { + return v.DefaultQueue +} + +// GetAgentTokens returns getClusterOrganizationCluster.AgentTokens, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetAgentTokens() getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection { + return v.AgentTokens +} + +// getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection includes the requested fields of the GraphQL type ClusterAgentTokenConnection. +type getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection struct { + Edges []getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge `json:"edges"` +} + +// GetEdges returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection.Edges, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection) GetEdges() []getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge { + return v.Edges +} + +// getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge includes the requested fields of the GraphQL type ClusterAgentTokenEdge. +type getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge struct { + Node getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken `json:"node"` +} + +// GetNode returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge.Node, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge) GetNode() getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken { + return v.Node +} + +// getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken includes the requested fields of the GraphQL type ClusterToken. +// The GraphQL type's documentation follows. +// +// A token used to connect an agent in cluster to Buildkite +type getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken struct { + CreatedBy getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser `json:"createdBy"` + Id string `json:"id"` + // A description about what this cluster agent token is used for + Description string `json:"description"` + // Agents registered with this token will use a unique token for each job. Please note that this feature is not yet available to all organizations + JobTokensEnabled bool `json:"jobTokensEnabled"` +} + +// GetCreatedBy returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken.CreatedBy, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken) GetCreatedBy() getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser { + return v.CreatedBy +} + +// GetId returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken.Id, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken) GetId() string { + return v.Id +} + +// GetDescription returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken.Description, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken) GetDescription() string { + return v.Description +} + +// GetJobTokensEnabled returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken.JobTokensEnabled, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken) GetJobTokensEnabled() bool { + return v.JobTokensEnabled +} + +// getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser includes the requested fields of the GraphQL type User. +// The GraphQL type's documentation follows. +// +// A user +type getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser struct { + // The name of the user + Name string `json:"name"` + Id string `json:"id"` +} + +// GetName returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser.Name, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser) GetName() string { + return v.Name +} + +// GetId returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser.Id, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser) GetId() string { + return v.Id +} + +// getClusterOrganizationClusterDefaultQueueClusterQueue includes the requested fields of the GraphQL type ClusterQueue. +type getClusterOrganizationClusterDefaultQueueClusterQueue struct { + Key string `json:"key"` + Id string `json:"id"` + // States whether job dispatch is paused for this cluster queue + DispatchPaused bool `json:"dispatchPaused"` + // The user who paused this cluster queue + DispatchPausedBy getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser `json:"dispatchPausedBy"` + Description string `json:"description"` + CreatedBy getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser `json:"createdBy"` +} + +// GetKey returns getClusterOrganizationClusterDefaultQueueClusterQueue.Key, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetKey() string { return v.Key } + +// GetId returns getClusterOrganizationClusterDefaultQueueClusterQueue.Id, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetId() string { return v.Id } + +// GetDispatchPaused returns getClusterOrganizationClusterDefaultQueueClusterQueue.DispatchPaused, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetDispatchPaused() bool { + return v.DispatchPaused +} + +// GetDispatchPausedBy returns getClusterOrganizationClusterDefaultQueueClusterQueue.DispatchPausedBy, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetDispatchPausedBy() getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser { + return v.DispatchPausedBy +} + +// GetDescription returns getClusterOrganizationClusterDefaultQueueClusterQueue.Description, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetDescription() string { + return v.Description +} + +// GetCreatedBy returns getClusterOrganizationClusterDefaultQueueClusterQueue.CreatedBy, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetCreatedBy() getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser { + return v.CreatedBy +} + +// getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser includes the requested fields of the GraphQL type User. +// The GraphQL type's documentation follows. +// +// A user +type getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser struct { + // The name of the user + Name string `json:"name"` + Id string `json:"id"` +} + +// GetName returns getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser.Name, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser) GetName() string { + return v.Name +} + +// GetId returns getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser.Id, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser) GetId() string { + return v.Id +} + +// getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser includes the requested fields of the GraphQL type User. +// The GraphQL type's documentation follows. +// +// A user +type getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser struct { + // The name of the user + Name string `json:"name"` + Id string `json:"id"` +} + +// GetName returns getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser.Name, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser) GetName() string { + return v.Name +} + +// GetId returns getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser.Id, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser) GetId() string { + return v.Id +} + +// getClusterResponse is returned by getCluster on success. +type getClusterResponse struct { + // Find an organization + Organization getClusterOrganization `json:"organization"` +} + +// GetOrganization returns getClusterResponse.Organization, and is useful for accessing the field via an interface. +func (v *getClusterResponse) GetOrganization() getClusterOrganization { return v.Organization } + // getOrganizationOrganization includes the requested fields of the GraphQL type Organization. // The GraphQL type's documentation follows. // @@ -669,6 +1023,31 @@ func (v *setApiIpAddressesResponse) GetOrganizationApiIpAllowlistUpdate() setApi return v.OrganizationApiIpAllowlistUpdate } +// updateClusterClusterUpdateClusterUpdatePayload includes the requested fields of the GraphQL type ClusterUpdatePayload. +// The GraphQL type's documentation follows. +// +// Autogenerated return type of ClusterUpdate. +type updateClusterClusterUpdateClusterUpdatePayload struct { + // A unique identifier for the client performing the mutation. + ClientMutationId string `json:"clientMutationId"` +} + +// GetClientMutationId returns updateClusterClusterUpdateClusterUpdatePayload.ClientMutationId, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayload) GetClientMutationId() string { + return v.ClientMutationId +} + +// updateClusterResponse is returned by updateCluster on success. +type updateClusterResponse struct { + // Updates a cluster. + ClusterUpdate updateClusterClusterUpdateClusterUpdatePayload `json:"clusterUpdate"` +} + +// GetClusterUpdate returns updateClusterResponse.ClusterUpdate, and is useful for accessing the field via an interface. +func (v *updateClusterResponse) GetClusterUpdate() updateClusterClusterUpdateClusterUpdatePayload { + return v.ClusterUpdate +} + // updatePipelinePipelineUpdatePipelineUpdatePayload includes the requested fields of the GraphQL type PipelineUpdatePayload. // The GraphQL type's documentation follows. // @@ -1031,6 +1410,43 @@ func createAgentToken( return &data, err } +// The query or mutation executed by createCluster. +const createCluster_Operation = ` +mutation createCluster ($input: ClusterCreateInput!) { + clusterCreate(input: $input) { + clientMutationId + cluster { + id + } + } +} +` + +func createCluster( + client graphql.Client, + input ClusterCreateInput, +) (*createClusterResponse, error) { + req := &graphql.Request{ + OpName: "createCluster", + Query: createCluster_Operation, + Variables: &__createClusterInput{ + Input: input, + }, + } + var err error + + var data createClusterResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + nil, + req, + resp, + ) + + return &data, err +} + // The query or mutation executed by getAgentToken. const getAgentToken_Operation = ` query getAgentToken ($slug: ID!) { @@ -1067,6 +1483,74 @@ func getAgentToken( return &data, err } +// The query or mutation executed by getCluster. +const getCluster_Operation = ` +query getCluster ($orgSlug: ID!, $id: ID!) { + organization(slug: $orgSlug) { + cluster(id: $id) { + name + id + uuid + description + defaultQueue { + key + id + dispatchPaused + dispatchPausedBy { + name + id + } + description + createdBy { + name + id + } + } + agentTokens { + edges { + node { + createdBy { + name + id + } + id + description + jobTokensEnabled + } + } + } + } + } +} +` + +func getCluster( + client graphql.Client, + orgSlug string, + id string, +) (*getClusterResponse, error) { + req := &graphql.Request{ + OpName: "getCluster", + Query: getCluster_Operation, + Variables: &__getClusterInput{ + OrgSlug: orgSlug, + Id: id, + }, + } + var err error + + var data getClusterResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + nil, + req, + resp, + ) + + return &data, err +} + // The query or mutation executed by getOrganization. const getOrganization_Operation = ` query getOrganization ($slug: ID!) { @@ -1265,6 +1749,40 @@ func setApiIpAddresses( return &data, err } +// The query or mutation executed by updateCluster. +const updateCluster_Operation = ` +mutation updateCluster ($input: ClusterUpdateInput!) { + clusterUpdate(input: $input) { + clientMutationId + } +} +` + +func updateCluster( + client graphql.Client, + input ClusterUpdateInput, +) (*updateClusterResponse, error) { + req := &graphql.Request{ + OpName: "updateCluster", + Query: updateCluster_Operation, + Variables: &__updateClusterInput{ + Input: input, + }, + } + var err error + + var data updateClusterResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + nil, + req, + resp, + ) + + return &data, err +} + // The query or mutation executed by updatePipeline. const updatePipeline_Operation = ` mutation updatePipeline ($input: PipelineUpdateInput!) { diff --git a/buildkite/graphql/cluster.graphql b/buildkite/graphql/cluster.graphql new file mode 100644 index 00000000..d7cdc31d --- /dev/null +++ b/buildkite/graphql/cluster.graphql @@ -0,0 +1,52 @@ +query getCluster($orgSlug: ID!, $id: ID!) { + organization(slug: $orgSlug) { + cluster(id: $id) { + name + id + uuid + description + defaultQueue { + key + id + dispatchPaused + dispatchPausedBy { + name + id + } + description + createdBy { + name + id + } + } + agentTokens { + edges { + node { + createdBy { + name + id + } + id + description + jobTokensEnabled + } + } + } + } + } +} + +mutation createCluster($input: ClusterCreateInput!) { + clusterCreate(input: $input) { + clientMutationId + cluster { + id + } + } +} + +mutation updateCluster($input: ClusterUpdateInput!) { + clusterUpdate(input: $input) { + clientMutationId + } +} diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go new file mode 100644 index 00000000..866f3d10 --- /dev/null +++ b/buildkite/resource_cluster.go @@ -0,0 +1,104 @@ +package buildkite + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +type ClusterResource struct { + client *Client +} + +type ClusterResourceModel struct { + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + Emoji types.String `tfsdk:"emoji"` + Color types.String `tfsdk:"color"` +} + +type ClusterResourceAPIModel struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + Emoji string `json:"emoji"` + Color string `json:"color"` +} + +func (c *ClusterResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = "_cluster" +} + +func (c *ClusterResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "A Cluster is a group of Agents that can be used to run your builds. " + + "Clusters are useful for grouping Agents by their capabilities, such as operating system, hardware, or location. ", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + }, + "name": schema.StringAttribute{ + MarkdownDescription: "The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.", + Required: true, + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description for the Cluster. Consider something short but clear on the Cluster's function.", + }, + "emoji": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "An emoji to represent the Cluster. Accepts the format :buildkite:.", + }, + "color": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A color representation of the Cluster. Accepts hex codes, eg #BADA55.", + }, + }, + } +} + +func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var data *ClusterResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + createReq := ClusterCreateInput{ + Name: data.Name.ValueString(), + Description: data.Description.ValueString(), + Emoji: data.Emoji.ValueString(), + Color: data.Color.ValueString(), + } + + r, err := createCluster(c.client.genqlient, createReq) + + if err != nil { + resp.Diagnostics.AddError( + "Unable to create Cluster", + fmt.Sprintf("Unable to create Cluster: %s", err.Error()), + ) + return + } + + data.ID = types.StringValue(r.ClusterCreate.Cluster.Id) + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} + +func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + /* ... */ +} + +func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + /* ... */ +} + +func (c *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + /* ... */ +} diff --git a/go.mod b/go.mod index 08526187..8b21c15c 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,9 @@ go 1.20 require ( github.com/Khan/genqlient v0.6.0 + github.com/hashicorp/terraform-plugin-framework v1.3.1 + github.com/hashicorp/terraform-plugin-go v0.15.0 + github.com/hashicorp/terraform-plugin-mux v0.10.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f ) @@ -14,12 +17,9 @@ require ( github.com/alexflint/go-arg v1.4.2 // indirect github.com/alexflint/go-scalar v1.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/dnephin/pflag v1.0.7 // indirect github.com/fatih/color v1.13.0 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -34,10 +34,7 @@ require ( github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.18.1 // indirect github.com/hashicorp/terraform-json v0.16.0 // indirect - github.com/hashicorp/terraform-plugin-framework v1.3.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.15.0 // indirect github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect - github.com/hashicorp/terraform-plugin-mux v0.10.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.0 // indirect github.com/hashicorp/terraform-svchost v0.0.1 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect @@ -53,17 +50,13 @@ require ( github.com/vektah/gqlparser v1.3.1 // indirect github.com/vektah/gqlparser/v2 v2.5.1 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect - github.com/vmihailenco/tagparser v0.1.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.13.1 // indirect golang.org/x/crypto v0.7.0 // indirect golang.org/x/mod v0.10.0 // indirect golang.org/x/net v0.9.0 // indirect - golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -71,5 +64,4 @@ require ( google.golang.org/grpc v1.54.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gotest.tools/gotestsum v1.10.0 // indirect ) diff --git a/go.sum b/go.sum index 5cc8e9b8..69d54737 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk= github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -25,7 +22,6 @@ github.com/alexflint/go-scalar v1.0.0/go.mod h1:GpHzbCOZXEKMEcygYQ5n/aa4Aq84zbxj github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= @@ -33,25 +29,17 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdK github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= -github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= -github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= @@ -62,32 +50,16 @@ github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6 github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= @@ -95,26 +67,20 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= -github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= -github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-plugin v1.4.9 h1:ESiK220/qE0aGxWdzKIvRH69iLiuN/PjoLTm69RoWtU= github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hc-install v0.5.0 h1:D9bl4KayIYKEeJ4vUDe9L5huqxZXczKaykSRcmQ0xY0= @@ -127,26 +93,18 @@ github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= github.com/hashicorp/terraform-json v0.16.0 h1:UKkeWRWb23do5LNAFlh/K3N0ymn1qTOO8c+85Albo3s= github.com/hashicorp/terraform-json v0.16.0/go.mod h1:v0Ufk9jJnk6tcIZvScHvetlKfiNTC+WS21mnXIlc0B0= -github.com/hashicorp/terraform-plugin-framework v1.3.0 h1:WtP1CIaWAfbzME17xoUXvJcyh5Ewu9attdhbfWNnYLs= -github.com/hashicorp/terraform-plugin-framework v1.3.0/go.mod h1:A1WD3Ry7FhrThViUTbkx4ZDsMq9oaAv4U9oTI8bBzCU= -github.com/hashicorp/terraform-plugin-go v0.14.3 h1:nlnJ1GXKdMwsC8g1Nh05tK2wsC3+3BL/DBBxFEki+j0= -github.com/hashicorp/terraform-plugin-go v0.14.3/go.mod h1:7ees7DMZ263q8wQ6E4RdIdR6nHHJtrdt4ogX5lPkX1A= +github.com/hashicorp/terraform-plugin-framework v1.3.1 h1:uhd+SuyuDq3oh5VB2Toq5IPyaC5XFAUf9vUFKBmNNOk= +github.com/hashicorp/terraform-plugin-framework v1.3.1/go.mod h1:A1WD3Ry7FhrThViUTbkx4ZDsMq9oaAv4U9oTI8bBzCU= github.com/hashicorp/terraform-plugin-go v0.15.0 h1:1BJNSUFs09DS8h/XNyJNJaeusQuWc/T9V99ylU9Zwp0= github.com/hashicorp/terraform-plugin-go v0.15.0/go.mod h1:tk9E3/Zx4RlF/9FdGAhwxHExqIHHldqiQGt20G6g+nQ= -github.com/hashicorp/terraform-plugin-log v0.8.0 h1:pX2VQ/TGKu+UU1rCay0OlzosNKe4Nz1pepLXj95oyy0= -github.com/hashicorp/terraform-plugin-log v0.8.0/go.mod h1:1myFrhVsBLeylQzYYEV17VVjtG8oYPRFdaZs7xdW2xs= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-mux v0.10.0 h1:VejY1BffxGy2iYOaa8DDHavY4k9jbvAE8F3lhruspKY= github.com/hashicorp/terraform-plugin-mux v0.10.0/go.mod h1:9sdnpmY20xIsl4ItsfODZYE+MgpSy/osXpSf+RwaZCY= github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 h1:G9WAfb8LHeCxu7Ae8nc1agZlQOSCUWsb610iAogBhCs= github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1/go.mod h1:xcOSYlRVdPLmDUoqPhO9fiO/YCN/l6MGYeTzGt5jgkQ= -github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U= -github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A= github.com/hashicorp/terraform-registry-address v0.2.0 h1:92LUg03NhfgZv44zpNTLBGIbiyTokQCDcdH5BhVHT3s= github.com/hashicorp/terraform-registry-address v0.2.0/go.mod h1:478wuzJPzdmqT6OGbB/iH82EDcI8VFM4yujknh/1nIs= -github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= -github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/terraform-svchost v0.0.1 h1:Zj6fR5wnpOHnJUmLyWozjMeDaVuE+cstMPj41/eKmSQ= github.com/hashicorp/terraform-svchost v0.0.1/go.mod h1:ut8JaH0vumgdCfJaihdcZULqkAwHdQNwNH7taIDdsZM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= @@ -170,7 +128,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -204,7 +161,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -213,7 +169,6 @@ github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f h1:tygelZueB1EtXk github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -233,27 +188,18 @@ github.com/vektah/gqlparser/v2 v2.5.1/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRF github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= -github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -261,48 +207,22 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -311,88 +231,46 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= -google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -413,8 +291,3 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/gotestsum v1.10.0 h1:lVO4uQJoxdsJb7jgmr1fg8QW7zGQ/tuqvsq5fHKyoHQ= -gotest.tools/gotestsum v1.10.0/go.mod h1:6JHCiN6TEjA7Kaz23q1bH0e2Dc3YJjDUZ0DmctFZf+w= -gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/schema.graphql b/schema.graphql index d0654df8..cc5dfb70 100644 --- a/schema.graphql +++ b/schema.graphql @@ -546,33 +546,33 @@ union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | A """All the possible types of subjects in an Audit Event""" enum AuditSubjectType { + SUITE_MONITOR + TEAM_PIPELINE + TEAM_SUITE + USER_EMAIL + SCM_PIPELINE_SETTINGS + USER_TOTP + SUITE + USER CLUSTER_PERMISSION + CLUSTER + AUTHORIZATION + SUBSCRIPTION AGENT_TOKEN API_ACCESS_TOKEN CLUSTER_QUEUE CLUSTER_TOKEN NOTIFICATION_SERVICE - SSO_PROVIDER ORGANIZATION ORGANIZATION_INVITATION - TEAM - ORGANIZATION_MEMBER + SSO_PROVIDER PIPELINE_SCHEDULE - TEAM_SUITE - SCM_SERVICE - SCM_PIPELINE_SETTINGS - SCM_REPOSITORY_HOST + ORGANIZATION_MEMBER TEAM_MEMBER - TEAM_PIPELINE - SUITE - CLUSTER - USER_TOTP - USER_EMAIL - SUITE_MONITOR - USER - AUTHORIZATION - SUBSCRIPTION + TEAM + SCM_SERVICE PIPELINE + SCM_REPOSITORY_HOST } """Context for an audit event created during a web request""" From 4b24e3b8ae13e954d167e9d4d41a9c366448c433 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 20 Jun 2023 16:21:33 +1000 Subject: [PATCH 02/37] No need for API model right now --- buildkite/resource_cluster.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 866f3d10..4a1a435b 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -21,14 +21,6 @@ type ClusterResourceModel struct { Color types.String `tfsdk:"color"` } -type ClusterResourceAPIModel struct { - ID string `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - Emoji string `json:"emoji"` - Color string `json:"color"` -} - func (c *ClusterResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = "_cluster" } From 7e6742f9612fea9a2f8a9d18db3d1d2bee0e8019 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 20 Jun 2023 16:34:13 +1000 Subject: [PATCH 03/37] CRUD complete for Cluster. --- buildkite/generated.go | 86 +++++++++++++++++++++++++++++++ buildkite/graphql/cluster.graphql | 6 +++ buildkite/resource_cluster.go | 71 +++++++++++++++++++++++-- schema.graphql | 18 +++---- 4 files changed, 169 insertions(+), 12 deletions(-) diff --git a/buildkite/generated.go b/buildkite/generated.go index 9208ac33..7d939df9 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -60,6 +60,25 @@ func (v *ClusterCreateInput) GetEmoji() string { return v.Emoji } // GetColor returns ClusterCreateInput.Color, and is useful for accessing the field via an interface. func (v *ClusterCreateInput) GetColor() string { return v.Color } +// Autogenerated input type of ClusterDelete +type ClusterDeleteInput struct { + // Autogenerated input type of ClusterDelete + ClientMutationId string `json:"clientMutationId"` + // Autogenerated input type of ClusterDelete + OrganizationId string `json:"organizationId"` + // Autogenerated input type of ClusterDelete + Id string `json:"id"` +} + +// GetClientMutationId returns ClusterDeleteInput.ClientMutationId, and is useful for accessing the field via an interface. +func (v *ClusterDeleteInput) GetClientMutationId() string { return v.ClientMutationId } + +// GetOrganizationId returns ClusterDeleteInput.OrganizationId, and is useful for accessing the field via an interface. +func (v *ClusterDeleteInput) GetOrganizationId() string { return v.OrganizationId } + +// GetId returns ClusterDeleteInput.Id, and is useful for accessing the field via an interface. +func (v *ClusterDeleteInput) GetId() string { return v.Id } + // Autogenerated input type of ClusterUpdate type ClusterUpdateInput struct { // Autogenerated input type of ClusterUpdate @@ -348,6 +367,14 @@ type __createClusterInput struct { // GetInput returns __createClusterInput.Input, and is useful for accessing the field via an interface. func (v *__createClusterInput) GetInput() ClusterCreateInput { return v.Input } +// __deleteClusterInput is used internally by genqlient +type __deleteClusterInput struct { + Input ClusterDeleteInput `json:"input"` +} + +// GetInput returns __deleteClusterInput.Input, and is useful for accessing the field via an interface. +func (v *__deleteClusterInput) GetInput() ClusterDeleteInput { return v.Input } + // __getAgentTokenInput is used internally by genqlient type __getAgentTokenInput struct { Slug string `json:"slug"` @@ -539,6 +566,31 @@ func (v *createClusterResponse) GetClusterCreate() createClusterClusterCreateClu return v.ClusterCreate } +// deleteClusterClusterDeleteClusterDeletePayload includes the requested fields of the GraphQL type ClusterDeletePayload. +// The GraphQL type's documentation follows. +// +// Autogenerated return type of ClusterDelete. +type deleteClusterClusterDeleteClusterDeletePayload struct { + // A unique identifier for the client performing the mutation. + ClientMutationId string `json:"clientMutationId"` +} + +// GetClientMutationId returns deleteClusterClusterDeleteClusterDeletePayload.ClientMutationId, and is useful for accessing the field via an interface. +func (v *deleteClusterClusterDeleteClusterDeletePayload) GetClientMutationId() string { + return v.ClientMutationId +} + +// deleteClusterResponse is returned by deleteCluster on success. +type deleteClusterResponse struct { + // Delete a cluster. + ClusterDelete deleteClusterClusterDeleteClusterDeletePayload `json:"clusterDelete"` +} + +// GetClusterDelete returns deleteClusterResponse.ClusterDelete, and is useful for accessing the field via an interface. +func (v *deleteClusterResponse) GetClusterDelete() deleteClusterClusterDeleteClusterDeletePayload { + return v.ClusterDelete +} + // getAgentTokenAgentToken includes the requested fields of the GraphQL type AgentToken. // The GraphQL type's documentation follows. // @@ -1447,6 +1499,40 @@ func createCluster( return &data, err } +// The query or mutation executed by deleteCluster. +const deleteCluster_Operation = ` +mutation deleteCluster ($input: ClusterDeleteInput!) { + clusterDelete(input: $input) { + clientMutationId + } +} +` + +func deleteCluster( + client graphql.Client, + input ClusterDeleteInput, +) (*deleteClusterResponse, error) { + req := &graphql.Request{ + OpName: "deleteCluster", + Query: deleteCluster_Operation, + Variables: &__deleteClusterInput{ + Input: input, + }, + } + var err error + + var data deleteClusterResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + nil, + req, + resp, + ) + + return &data, err +} + // The query or mutation executed by getAgentToken. const getAgentToken_Operation = ` query getAgentToken ($slug: ID!) { diff --git a/buildkite/graphql/cluster.graphql b/buildkite/graphql/cluster.graphql index d7cdc31d..68635b7d 100644 --- a/buildkite/graphql/cluster.graphql +++ b/buildkite/graphql/cluster.graphql @@ -50,3 +50,9 @@ mutation updateCluster($input: ClusterUpdateInput!) { clientMutationId } } + +mutation deleteCluster($input: ClusterDeleteInput!) { + clusterDelete(input: $input) { + clientMutationId + } +} diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 4a1a435b..904dc676 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -84,13 +84,78 @@ func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest } func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - /* ... */ + var data ClusterResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + cluster, err := getCluster(c.client.genqlient, c.client.organizationId, data.ID.ValueString()) + + if err != nil { + resp.Diagnostics.AddError( + "Unable to read Cluster", + fmt.Sprintf("Unable to read Cluster: %s", err.Error()), + ) + return + } + + data.Name = types.StringValue(cluster.Organization.Cluster.Name) + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - /* ... */ + var data ClusterResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + updateReq := ClusterUpdateInput{ + Name: data.Name.ValueString(), + Description: data.Description.ValueString(), + Emoji: data.Emoji.ValueString(), + Color: data.Color.ValueString(), + } + + _, err := updateCluster(c.client.genqlient, updateReq) + + if err != nil { + resp.Diagnostics.AddError( + "Unable to update Cluster", + fmt.Sprintf("Unable to update Cluster: %s", err.Error()), + ) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } func (c *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - /* ... */ + var data ClusterResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + deleteReq := ClusterDeleteInput{ + Id: data.ID.ValueString(), + } + + _, err := deleteCluster(c.client.genqlient, deleteReq) + + if err != nil { + resp.Diagnostics.AddError( + "Unable to delete Cluster", + fmt.Sprintf("Unable to delete Cluster: %s", err.Error()), + ) + return + } } diff --git a/schema.graphql b/schema.graphql index cc5dfb70..f318d307 100644 --- a/schema.graphql +++ b/schema.graphql @@ -546,13 +546,15 @@ union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | A """All the possible types of subjects in an Audit Event""" enum AuditSubjectType { - SUITE_MONITOR + SCM_PIPELINE_SETTINGS + SCM_REPOSITORY_HOST + TEAM_MEMBER TEAM_PIPELINE - TEAM_SUITE + PIPELINE + SUITE_MONITOR + SUITE USER_EMAIL - SCM_PIPELINE_SETTINGS USER_TOTP - SUITE USER CLUSTER_PERMISSION CLUSTER @@ -564,15 +566,13 @@ enum AuditSubjectType { CLUSTER_TOKEN NOTIFICATION_SERVICE ORGANIZATION - ORGANIZATION_INVITATION SSO_PROVIDER - PIPELINE_SCHEDULE + ORGANIZATION_INVITATION ORGANIZATION_MEMBER - TEAM_MEMBER TEAM + PIPELINE_SCHEDULE + TEAM_SUITE SCM_SERVICE - PIPELINE - SCM_REPOSITORY_HOST } """Context for an audit event created during a web request""" From ca2744507f96b2d3ae38d479498ae5d6ca168f93 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 21 Jun 2023 12:34:57 +1000 Subject: [PATCH 04/37] Saving for later development --- buildkite/generated.go | 72 +++++++++++++------------------ buildkite/graphql/cluster.graphql | 6 ++- buildkite/provider.go | 4 +- buildkite/resource_cluster.go | 15 ++++--- schema.graphql | 28 +++++++----- tf-proj/main.tf | 26 +++-------- 6 files changed, 70 insertions(+), 81 deletions(-) diff --git a/buildkite/generated.go b/buildkite/generated.go index 7d939df9..57515c9c 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -26,40 +26,6 @@ const ( BuildRetentionPeriodsYears2 BuildRetentionPeriods = "YEARS_2" ) -// Autogenerated input type of ClusterCreate -type ClusterCreateInput struct { - // Autogenerated input type of ClusterCreate - ClientMutationId string `json:"clientMutationId"` - // Autogenerated input type of ClusterCreate - OrganizationId string `json:"organizationId"` - // Autogenerated input type of ClusterCreate - Name string `json:"name"` - // Autogenerated input type of ClusterCreate - Description string `json:"description"` - // Autogenerated input type of ClusterCreate - Emoji string `json:"emoji"` - // Autogenerated input type of ClusterCreate - Color string `json:"color"` -} - -// GetClientMutationId returns ClusterCreateInput.ClientMutationId, and is useful for accessing the field via an interface. -func (v *ClusterCreateInput) GetClientMutationId() string { return v.ClientMutationId } - -// GetOrganizationId returns ClusterCreateInput.OrganizationId, and is useful for accessing the field via an interface. -func (v *ClusterCreateInput) GetOrganizationId() string { return v.OrganizationId } - -// GetName returns ClusterCreateInput.Name, and is useful for accessing the field via an interface. -func (v *ClusterCreateInput) GetName() string { return v.Name } - -// GetDescription returns ClusterCreateInput.Description, and is useful for accessing the field via an interface. -func (v *ClusterCreateInput) GetDescription() string { return v.Description } - -// GetEmoji returns ClusterCreateInput.Emoji, and is useful for accessing the field via an interface. -func (v *ClusterCreateInput) GetEmoji() string { return v.Emoji } - -// GetColor returns ClusterCreateInput.Color, and is useful for accessing the field via an interface. -func (v *ClusterCreateInput) GetColor() string { return v.Color } - // Autogenerated input type of ClusterDelete type ClusterDeleteInput struct { // Autogenerated input type of ClusterDelete @@ -361,11 +327,27 @@ func (v *__createAgentTokenInput) GetDescription() string { return v.Description // __createClusterInput is used internally by genqlient type __createClusterInput struct { - Input ClusterCreateInput `json:"input"` + OrganizationId string `json:"organizationId"` + Name string `json:"name"` + Description string `json:"description"` + Emoji string `json:"emoji"` + Color string `json:"color"` } -// GetInput returns __createClusterInput.Input, and is useful for accessing the field via an interface. -func (v *__createClusterInput) GetInput() ClusterCreateInput { return v.Input } +// GetOrganizationId returns __createClusterInput.OrganizationId, and is useful for accessing the field via an interface. +func (v *__createClusterInput) GetOrganizationId() string { return v.OrganizationId } + +// GetName returns __createClusterInput.Name, and is useful for accessing the field via an interface. +func (v *__createClusterInput) GetName() string { return v.Name } + +// GetDescription returns __createClusterInput.Description, and is useful for accessing the field via an interface. +func (v *__createClusterInput) GetDescription() string { return v.Description } + +// GetEmoji returns __createClusterInput.Emoji, and is useful for accessing the field via an interface. +func (v *__createClusterInput) GetEmoji() string { return v.Emoji } + +// GetColor returns __createClusterInput.Color, and is useful for accessing the field via an interface. +func (v *__createClusterInput) GetColor() string { return v.Color } // __deleteClusterInput is used internally by genqlient type __deleteClusterInput struct { @@ -1464,8 +1446,8 @@ func createAgentToken( // The query or mutation executed by createCluster. const createCluster_Operation = ` -mutation createCluster ($input: ClusterCreateInput!) { - clusterCreate(input: $input) { +mutation createCluster ($organizationId: ID!, $name: String!, $description: String, $emoji: String, $color: String) { + clusterCreate(input: {organizationId:$organizationId,name:$name,description:$description,emoji:$emoji,color:$color}) { clientMutationId cluster { id @@ -1476,13 +1458,21 @@ mutation createCluster ($input: ClusterCreateInput!) { func createCluster( client graphql.Client, - input ClusterCreateInput, + organizationId string, + name string, + description string, + emoji string, + color string, ) (*createClusterResponse, error) { req := &graphql.Request{ OpName: "createCluster", Query: createCluster_Operation, Variables: &__createClusterInput{ - Input: input, + OrganizationId: organizationId, + Name: name, + Description: description, + Emoji: emoji, + Color: color, }, } var err error diff --git a/buildkite/graphql/cluster.graphql b/buildkite/graphql/cluster.graphql index 68635b7d..daadf3d7 100644 --- a/buildkite/graphql/cluster.graphql +++ b/buildkite/graphql/cluster.graphql @@ -36,8 +36,10 @@ query getCluster($orgSlug: ID!, $id: ID!) { } } -mutation createCluster($input: ClusterCreateInput!) { - clusterCreate(input: $input) { +mutation createCluster($organizationId: ID!, $name: String!, $description: String, $emoji: String, $color: String) { + clusterCreate( + input: { organizationId: $organizationId, name: $name, description: $description, emoji: $emoji, color: $color } + ) { clientMutationId cluster { id diff --git a/buildkite/provider.go b/buildkite/provider.go index fd972ef8..a0a2939d 100644 --- a/buildkite/provider.go +++ b/buildkite/provider.go @@ -90,7 +90,9 @@ func (tf *terraformProvider) Metadata(ctx context.Context, req provider.Metadata } func (*terraformProvider) Resources(context.Context) []func() resource.Resource { - return []func() resource.Resource{} + return []func() resource.Resource{ + NewClusterResource, + } } func (*terraformProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) { diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 904dc676..7d07cb8f 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -21,8 +21,12 @@ type ClusterResourceModel struct { Color types.String `tfsdk:"color"` } +func NewClusterResource() resource.Resource { + return &ClusterResource{} +} + func (c *ClusterResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = "_cluster" + resp.TypeName = req.ProviderTypeName + "_cluster" } func (c *ClusterResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -62,10 +66,11 @@ func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest } createReq := ClusterCreateInput{ - Name: data.Name.ValueString(), - Description: data.Description.ValueString(), - Emoji: data.Emoji.ValueString(), - Color: data.Color.ValueString(), + Name: data.Name.ValueString(), + Description: data.Description.ValueString(), + Emoji: data.Emoji.ValueString(), + Color: data.Color.ValueString(), + OrganizationId: c.client.organizationId, } r, err := createCluster(c.client.genqlient, createReq) diff --git a/schema.graphql b/schema.graphql index f318d307..72849dd5 100644 --- a/schema.graphql +++ b/schema.graphql @@ -546,18 +546,20 @@ union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | A """All the possible types of subjects in an Audit Event""" enum AuditSubjectType { + TEAM_SUITE + SCM_SERVICE SCM_PIPELINE_SETTINGS SCM_REPOSITORY_HOST - TEAM_MEMBER - TEAM_PIPELINE - PIPELINE - SUITE_MONITOR + SSO_PROVIDER + ORGANIZATION_MEMBER SUITE - USER_EMAIL + TEAM USER_TOTP + USER_EMAIL + SUITE_MONITOR USER - CLUSTER_PERMISSION CLUSTER + CLUSTER_PERMISSION AUTHORIZATION SUBSCRIPTION AGENT_TOKEN @@ -566,13 +568,11 @@ enum AuditSubjectType { CLUSTER_TOKEN NOTIFICATION_SERVICE ORGANIZATION - SSO_PROVIDER ORGANIZATION_INVITATION - ORGANIZATION_MEMBER - TEAM PIPELINE_SCHEDULE - TEAM_SUITE - SCM_SERVICE + PIPELINE + TEAM_MEMBER + TEAM_PIPELINE } """Context for an audit event created during a web request""" @@ -1070,6 +1070,8 @@ input ClusterAgentTokenCreateInput { clusterId: ID! """Autogenerated input type of ClusterAgentTokenCreate""" jobTokensEnabled: Boolean +"""Autogenerated input type of ClusterAgentTokenCreate""" + allowedIpAddresses: String } """Autogenerated return type of ClusterAgentTokenCreate.""" @@ -1115,6 +1117,8 @@ input ClusterAgentTokenUpdateInput { description: String! """Autogenerated input type of ClusterAgentTokenUpdate""" jobTokensEnabled: Boolean +"""Autogenerated input type of ClusterAgentTokenUpdate""" + allowedIpAddresses: String } """Autogenerated return type of ClusterAgentTokenUpdate.""" @@ -1328,6 +1332,8 @@ type ClusterQueueUpdatePayload { """A token used to connect an agent in cluster to Buildkite""" type ClusterToken implements Node{ +"""A list of CIDR-notation IPv4 addresses from which agents can use this token. Please note that this feature is not yet available to all organizations""" + allowedIpAddresses: String cluster: Cluster createdBy: User """A description about what this cluster agent token is used for""" diff --git a/tf-proj/main.tf b/tf-proj/main.tf index 9ad31bb1..dfd507c8 100644 --- a/tf-proj/main.tf +++ b/tf-proj/main.tf @@ -2,33 +2,17 @@ terraform { required_providers { buildkite = { source = "buildkite/buildkite" - version = "0.12.1" + version = "0.19.0" } } } provider "buildkite" { + organization = "testkite" } -resource "buildkite_pipeline" "test_new" { - name = "Testing Timeouts" - repository = "https://github.com/buildkite/terraform-provider-buildkite.git" - - steps = "" - default_timeout_in_minutes = 15 - maximum_timeout_in_minutes = 60 -} - -resource "buildkite_pipeline_schedule" "test_scheduled" { - pipeline_id = buildkite_pipeline.test_new.id - label = "Test Scheduled" - cronline = "0 0 * * *" - branch = "master" - commit = "HEAD" - message = "Test Scheduled Builds in Terraform" -} - -output "badge_url" { - value = buildkite_pipeline.test_new.badge_url +resource "buildkite_cluster" "test_cluster" { + name = "test-cluster" + description = "test cluster" } From 1115cc11f252adca2ce974db16e9393a27006b37 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 21 Jun 2023 14:13:06 +1000 Subject: [PATCH 05/37] Cluster resource complete --- buildkite/generated.go | 147 ++++++++++++------------------ buildkite/graphql/cluster.graphql | 11 ++- buildkite/provider.go | 1 + buildkite/resource_cluster.go | 75 ++++++++------- schema.graphql | 45 +++------ 5 files changed, 126 insertions(+), 153 deletions(-) diff --git a/buildkite/generated.go b/buildkite/generated.go index 5bfbe708..39251a3b 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -26,69 +26,6 @@ const ( BuildRetentionPeriodsYears2 BuildRetentionPeriods = "YEARS_2" ) -// Autogenerated input type of ClusterDelete -type ClusterDeleteInput struct { - // Autogenerated input type of ClusterDelete - ClientMutationId string `json:"clientMutationId"` - // Autogenerated input type of ClusterDelete - OrganizationId string `json:"organizationId"` - // Autogenerated input type of ClusterDelete - Id string `json:"id"` -} - -// GetClientMutationId returns ClusterDeleteInput.ClientMutationId, and is useful for accessing the field via an interface. -func (v *ClusterDeleteInput) GetClientMutationId() string { return v.ClientMutationId } - -// GetOrganizationId returns ClusterDeleteInput.OrganizationId, and is useful for accessing the field via an interface. -func (v *ClusterDeleteInput) GetOrganizationId() string { return v.OrganizationId } - -// GetId returns ClusterDeleteInput.Id, and is useful for accessing the field via an interface. -func (v *ClusterDeleteInput) GetId() string { return v.Id } - -// Autogenerated input type of ClusterUpdate -type ClusterUpdateInput struct { - // Autogenerated input type of ClusterUpdate - ClientMutationId string `json:"clientMutationId"` - // Autogenerated input type of ClusterUpdate - OrganizationId string `json:"organizationId"` - // Autogenerated input type of ClusterUpdate - Id string `json:"id"` - // Autogenerated input type of ClusterUpdate - Name string `json:"name"` - // Autogenerated input type of ClusterUpdate - Description string `json:"description"` - // Autogenerated input type of ClusterUpdate - Emoji string `json:"emoji"` - // Autogenerated input type of ClusterUpdate - Color string `json:"color"` - // Autogenerated input type of ClusterUpdate - DefaultQueueId string `json:"defaultQueueId"` -} - -// GetClientMutationId returns ClusterUpdateInput.ClientMutationId, and is useful for accessing the field via an interface. -func (v *ClusterUpdateInput) GetClientMutationId() string { return v.ClientMutationId } - -// GetOrganizationId returns ClusterUpdateInput.OrganizationId, and is useful for accessing the field via an interface. -func (v *ClusterUpdateInput) GetOrganizationId() string { return v.OrganizationId } - -// GetId returns ClusterUpdateInput.Id, and is useful for accessing the field via an interface. -func (v *ClusterUpdateInput) GetId() string { return v.Id } - -// GetName returns ClusterUpdateInput.Name, and is useful for accessing the field via an interface. -func (v *ClusterUpdateInput) GetName() string { return v.Name } - -// GetDescription returns ClusterUpdateInput.Description, and is useful for accessing the field via an interface. -func (v *ClusterUpdateInput) GetDescription() string { return v.Description } - -// GetEmoji returns ClusterUpdateInput.Emoji, and is useful for accessing the field via an interface. -func (v *ClusterUpdateInput) GetEmoji() string { return v.Emoji } - -// GetColor returns ClusterUpdateInput.Color, and is useful for accessing the field via an interface. -func (v *ClusterUpdateInput) GetColor() string { return v.Color } - -// GetDefaultQueueId returns ClusterUpdateInput.DefaultQueueId, and is useful for accessing the field via an interface. -func (v *ClusterUpdateInput) GetDefaultQueueId() string { return v.DefaultQueueId } - // The roles a user can be within a team type GTeamMemberRole string @@ -351,11 +288,15 @@ func (v *__createClusterInput) GetColor() string { return v.Color } // __deleteClusterInput is used internally by genqlient type __deleteClusterInput struct { - Input ClusterDeleteInput `json:"input"` + OrganizationId string `json:"organizationId"` + Id string `json:"id"` } -// GetInput returns __deleteClusterInput.Input, and is useful for accessing the field via an interface. -func (v *__deleteClusterInput) GetInput() ClusterDeleteInput { return v.Input } +// GetOrganizationId returns __deleteClusterInput.OrganizationId, and is useful for accessing the field via an interface. +func (v *__deleteClusterInput) GetOrganizationId() string { return v.OrganizationId } + +// GetId returns __deleteClusterInput.Id, and is useful for accessing the field via an interface. +func (v *__deleteClusterInput) GetId() string { return v.Id } // __getAgentTokenInput is used internally by genqlient type __getAgentTokenInput struct { @@ -427,11 +368,27 @@ func (v *__setApiIpAddressesInput) GetIpAddresses() string { return v.IpAddresse // __updateClusterInput is used internally by genqlient type __updateClusterInput struct { - Input ClusterUpdateInput `json:"input"` + OrganizationId string `json:"organizationId"` + Name string `json:"name"` + Description string `json:"description"` + Emoji string `json:"emoji"` + Color string `json:"color"` } -// GetInput returns __updateClusterInput.Input, and is useful for accessing the field via an interface. -func (v *__updateClusterInput) GetInput() ClusterUpdateInput { return v.Input } +// GetOrganizationId returns __updateClusterInput.OrganizationId, and is useful for accessing the field via an interface. +func (v *__updateClusterInput) GetOrganizationId() string { return v.OrganizationId } + +// GetName returns __updateClusterInput.Name, and is useful for accessing the field via an interface. +func (v *__updateClusterInput) GetName() string { return v.Name } + +// GetDescription returns __updateClusterInput.Description, and is useful for accessing the field via an interface. +func (v *__updateClusterInput) GetDescription() string { return v.Description } + +// GetEmoji returns __updateClusterInput.Emoji, and is useful for accessing the field via an interface. +func (v *__updateClusterInput) GetEmoji() string { return v.Emoji } + +// GetColor returns __updateClusterInput.Color, and is useful for accessing the field via an interface. +func (v *__updateClusterInput) GetColor() string { return v.Color } // __updatePipelineInput is used internally by genqlient type __updatePipelineInput struct { @@ -532,11 +489,16 @@ func (v *createClusterClusterCreateClusterCreatePayload) GetCluster() createClus // createClusterClusterCreateClusterCreatePayloadCluster includes the requested fields of the GraphQL type Cluster. type createClusterClusterCreateClusterCreatePayloadCluster struct { Id string `json:"id"` + // The public UUID for this cluster + Uuid string `json:"uuid"` } // GetId returns createClusterClusterCreateClusterCreatePayloadCluster.Id, and is useful for accessing the field via an interface. func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetId() string { return v.Id } +// GetUuid returns createClusterClusterCreateClusterCreatePayloadCluster.Uuid, and is useful for accessing the field via an interface. +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetUuid() string { return v.Uuid } + // createClusterResponse is returned by createCluster on success. type createClusterResponse struct { // Create a cluster. @@ -1057,29 +1019,29 @@ func (v *setApiIpAddressesResponse) GetOrganizationApiIpAllowlistUpdate() setApi return v.OrganizationApiIpAllowlistUpdate } -// updateClusterClusterUpdateClusterUpdatePayload includes the requested fields of the GraphQL type ClusterUpdatePayload. +// updateClusterClusterCreateClusterCreatePayload includes the requested fields of the GraphQL type ClusterCreatePayload. // The GraphQL type's documentation follows. // -// Autogenerated return type of ClusterUpdate. -type updateClusterClusterUpdateClusterUpdatePayload struct { +// Autogenerated return type of ClusterCreate. +type updateClusterClusterCreateClusterCreatePayload struct { // A unique identifier for the client performing the mutation. ClientMutationId string `json:"clientMutationId"` } -// GetClientMutationId returns updateClusterClusterUpdateClusterUpdatePayload.ClientMutationId, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayload) GetClientMutationId() string { +// GetClientMutationId returns updateClusterClusterCreateClusterCreatePayload.ClientMutationId, and is useful for accessing the field via an interface. +func (v *updateClusterClusterCreateClusterCreatePayload) GetClientMutationId() string { return v.ClientMutationId } // updateClusterResponse is returned by updateCluster on success. type updateClusterResponse struct { - // Updates a cluster. - ClusterUpdate updateClusterClusterUpdateClusterUpdatePayload `json:"clusterUpdate"` + // Create a cluster. + ClusterCreate updateClusterClusterCreateClusterCreatePayload `json:"clusterCreate"` } -// GetClusterUpdate returns updateClusterResponse.ClusterUpdate, and is useful for accessing the field via an interface. -func (v *updateClusterResponse) GetClusterUpdate() updateClusterClusterUpdateClusterUpdatePayload { - return v.ClusterUpdate +// GetClusterCreate returns updateClusterResponse.ClusterCreate, and is useful for accessing the field via an interface. +func (v *updateClusterResponse) GetClusterCreate() updateClusterClusterCreateClusterCreatePayload { + return v.ClusterCreate } // updatePipelinePipelineUpdatePipelineUpdatePayload includes the requested fields of the GraphQL type PipelineUpdatePayload. @@ -1451,6 +1413,7 @@ mutation createCluster ($organizationId: ID!, $name: String!, $description: Stri clientMutationId cluster { id + uuid } } } @@ -1491,8 +1454,8 @@ func createCluster( // The query or mutation executed by deleteCluster. const deleteCluster_Operation = ` -mutation deleteCluster ($input: ClusterDeleteInput!) { - clusterDelete(input: $input) { +mutation deleteCluster ($organizationId: ID!, $id: ID!) { + clusterDelete(input: {organizationId:$organizationId,id:$id}) { clientMutationId } } @@ -1500,13 +1463,15 @@ mutation deleteCluster ($input: ClusterDeleteInput!) { func deleteCluster( client graphql.Client, - input ClusterDeleteInput, + organizationId string, + id string, ) (*deleteClusterResponse, error) { req := &graphql.Request{ OpName: "deleteCluster", Query: deleteCluster_Operation, Variables: &__deleteClusterInput{ - Input: input, + OrganizationId: organizationId, + Id: id, }, } var err error @@ -1827,8 +1792,8 @@ func setApiIpAddresses( // The query or mutation executed by updateCluster. const updateCluster_Operation = ` -mutation updateCluster ($input: ClusterUpdateInput!) { - clusterUpdate(input: $input) { +mutation updateCluster ($organizationId: ID!, $name: String!, $description: String, $emoji: String, $color: String) { + clusterCreate(input: {organizationId:$organizationId,name:$name,description:$description,emoji:$emoji,color:$color}) { clientMutationId } } @@ -1836,13 +1801,21 @@ mutation updateCluster ($input: ClusterUpdateInput!) { func updateCluster( client graphql.Client, - input ClusterUpdateInput, + organizationId string, + name string, + description string, + emoji string, + color string, ) (*updateClusterResponse, error) { req := &graphql.Request{ OpName: "updateCluster", Query: updateCluster_Operation, Variables: &__updateClusterInput{ - Input: input, + OrganizationId: organizationId, + Name: name, + Description: description, + Emoji: emoji, + Color: color, }, } var err error diff --git a/buildkite/graphql/cluster.graphql b/buildkite/graphql/cluster.graphql index daadf3d7..e998378e 100644 --- a/buildkite/graphql/cluster.graphql +++ b/buildkite/graphql/cluster.graphql @@ -43,18 +43,21 @@ mutation createCluster($organizationId: ID!, $name: String!, $description: Strin clientMutationId cluster { id + uuid } } } -mutation updateCluster($input: ClusterUpdateInput!) { - clusterUpdate(input: $input) { +mutation updateCluster($organizationId: ID!, $name: String!, $description: String, $emoji: String, $color: String) { + clusterCreate( + input: { organizationId: $organizationId, name: $name, description: $description, emoji: $emoji, color: $color } + ) { clientMutationId } } -mutation deleteCluster($input: ClusterDeleteInput!) { - clusterDelete(input: $input) { +mutation deleteCluster($organizationId: ID!, $id: ID!) { + clusterDelete(input: { organizationId: $organizationId, id: $id }) { clientMutationId } } diff --git a/buildkite/provider.go b/buildkite/provider.go index b42ac5a6..f82dd2aa 100644 --- a/buildkite/provider.go +++ b/buildkite/provider.go @@ -92,6 +92,7 @@ func (tf *terraformProvider) Metadata(ctx context.Context, req provider.Metadata func (*terraformProvider) Resources(context.Context) []func() resource.Resource { return []func() resource.Resource{ NewAgentTokenResource, + NewClusterResource, } } diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 7d07cb8f..ceb111ce 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-framework/resource/schema" + resource_schema "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -19,6 +19,7 @@ type ClusterResourceModel struct { Description types.String `tfsdk:"description"` Emoji types.String `tfsdk:"emoji"` Color types.String `tfsdk:"color"` + UUID types.String `tfsdk:"uuid"` } func NewClusterResource() resource.Resource { @@ -29,27 +30,38 @@ func (c *ClusterResource) Metadata(ctx context.Context, req resource.MetadataReq resp.TypeName = req.ProviderTypeName + "_cluster" } +func (c *ClusterResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + c.client = req.ProviderData.(*Client) +} + func (c *ClusterResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema = schema.Schema{ + resp.Schema = resource_schema.Schema{ MarkdownDescription: "A Cluster is a group of Agents that can be used to run your builds. " + "Clusters are useful for grouping Agents by their capabilities, such as operating system, hardware, or location. ", - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ + Attributes: map[string]resource_schema.Attribute{ + "id": resource_schema.StringAttribute{ + Computed: true, + }, + "uuid": resource_schema.StringAttribute{ Computed: true, }, - "name": schema.StringAttribute{ + "name": resource_schema.StringAttribute{ MarkdownDescription: "The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.", Required: true, }, - "description": schema.StringAttribute{ + "description": resource_schema.StringAttribute{ Optional: true, MarkdownDescription: "A description for the Cluster. Consider something short but clear on the Cluster's function.", }, - "emoji": schema.StringAttribute{ + "emoji": resource_schema.StringAttribute{ Optional: true, MarkdownDescription: "An emoji to represent the Cluster. Accepts the format :buildkite:.", }, - "color": schema.StringAttribute{ + "color": resource_schema.StringAttribute{ Optional: true, MarkdownDescription: "A color representation of the Cluster. Accepts hex codes, eg #BADA55.", }, @@ -58,22 +70,21 @@ func (c *ClusterResource) Schema(ctx context.Context, req resource.SchemaRequest } func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var data *ClusterResourceModel + var data ClusterResourceModel resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) if resp.Diagnostics.HasError() { return } - createReq := ClusterCreateInput{ - Name: data.Name.ValueString(), - Description: data.Description.ValueString(), - Emoji: data.Emoji.ValueString(), - Color: data.Color.ValueString(), - OrganizationId: c.client.organizationId, - } - - r, err := createCluster(c.client.genqlient, createReq) + r, err := createCluster( + c.client.genqlient, + c.client.organizationId, + data.Name.ValueString(), + data.Description.ValueString(), + data.Emoji.ValueString(), + data.Color.ValueString(), + ) if err != nil { resp.Diagnostics.AddError( @@ -84,6 +95,7 @@ func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest } data.ID = types.StringValue(r.ClusterCreate.Cluster.Id) + data.UUID = types.StringValue(r.ClusterCreate.Cluster.Uuid) resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } @@ -97,7 +109,7 @@ func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, re return } - cluster, err := getCluster(c.client.genqlient, c.client.organizationId, data.ID.ValueString()) + cluster, err := getCluster(c.client.genqlient, c.client.organization, data.ID.ValueString()) if err != nil { resp.Diagnostics.AddError( @@ -107,7 +119,10 @@ func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, re return } + data.ID = types.StringValue(cluster.Organization.Cluster.Id) data.Name = types.StringValue(cluster.Organization.Cluster.Name) + data.Description = types.StringValue(cluster.Organization.Cluster.Description) + data.UUID = types.StringValue(cluster.Organization.Cluster.Uuid) resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } @@ -121,14 +136,14 @@ func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest return } - updateReq := ClusterUpdateInput{ - Name: data.Name.ValueString(), - Description: data.Description.ValueString(), - Emoji: data.Emoji.ValueString(), - Color: data.Color.ValueString(), - } - - _, err := updateCluster(c.client.genqlient, updateReq) + _, err := updateCluster( + c.client.genqlient, + c.client.organizationId, + data.Name.ValueString(), + data.Description.ValueString(), + data.Emoji.ValueString(), + data.Color.ValueString(), + ) if err != nil { resp.Diagnostics.AddError( @@ -150,11 +165,7 @@ func (c *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest return } - deleteReq := ClusterDeleteInput{ - Id: data.ID.ValueString(), - } - - _, err := deleteCluster(c.client.genqlient, deleteReq) + _, err := deleteCluster(c.client.genqlient, c.client.organizationId, data.ID.ValueString()) if err != nil { resp.Diagnostics.AddError( diff --git a/schema.graphql b/schema.graphql index 8a7b6b74..1fd3a519 100644 --- a/schema.graphql +++ b/schema.graphql @@ -546,48 +546,33 @@ union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | A """All the possible types of subjects in an Audit Event""" enum AuditSubjectType { - TEAM_SUITE + AGENT_TOKEN + API_ACCESS_TOKEN + CLUSTER_QUEUE + CLUSTER_TOKEN + NOTIFICATION_SERVICE + ORGANIZATION + ORGANIZATION_INVITATION + PIPELINE_SCHEDULE + ORGANIZATION_MEMBER + TEAM_MEMBER + TEAM_PIPELINE + TEAM SCM_SERVICE SCM_PIPELINE_SETTINGS + TEAM_SUITE SCM_REPOSITORY_HOST -<<<<<<< HEAD - SSO_PROVIDER - ORGANIZATION_MEMBER - SUITE - TEAM - USER_TOTP - USER_EMAIL SUITE_MONITOR -======= - SUITE_MONITOR - PIPELINE - PIPELINE_SCHEDULE - TEAM SUITE USER_EMAIL - USER_TOTP ->>>>>>> origin/main + SSO_PROVIDER USER + USER_TOTP CLUSTER CLUSTER_PERMISSION AUTHORIZATION SUBSCRIPTION - AGENT_TOKEN - API_ACCESS_TOKEN - CLUSTER_QUEUE - CLUSTER_TOKEN - NOTIFICATION_SERVICE - ORGANIZATION - ORGANIZATION_INVITATION -<<<<<<< HEAD - PIPELINE_SCHEDULE PIPELINE -======= - SSO_PROVIDER - ORGANIZATION_MEMBER ->>>>>>> origin/main - TEAM_MEMBER - TEAM_PIPELINE } """Context for an audit event created during a web request""" From 50d26afca473a5d2722937aa6ba36201829e087f Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Thu, 22 Jun 2023 15:30:34 +1000 Subject: [PATCH 06/37] Improve GraphQL queries for more data. --- buildkite/generated.go | 81 ++++++++++++++++++++++++++----- buildkite/graphql/cluster.graphql | 28 +++++++++-- buildkite/resource_cluster.go | 75 ++++++++++++++-------------- schema.graphql | 10 ++-- tf-proj/main.tf | 2 +- 5 files changed, 138 insertions(+), 58 deletions(-) diff --git a/buildkite/generated.go b/buildkite/generated.go index 39251a3b..3a191b0d 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -369,6 +369,7 @@ func (v *__setApiIpAddressesInput) GetIpAddresses() string { return v.IpAddresse // __updateClusterInput is used internally by genqlient type __updateClusterInput struct { OrganizationId string `json:"organizationId"` + Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` Emoji string `json:"emoji"` @@ -378,6 +379,9 @@ type __updateClusterInput struct { // GetOrganizationId returns __updateClusterInput.OrganizationId, and is useful for accessing the field via an interface. func (v *__updateClusterInput) GetOrganizationId() string { return v.OrganizationId } +// GetId returns __updateClusterInput.Id, and is useful for accessing the field via an interface. +func (v *__updateClusterInput) GetId() string { return v.Id } + // GetName returns __updateClusterInput.Name, and is useful for accessing the field via an interface. func (v *__updateClusterInput) GetName() string { return v.Name } @@ -1019,29 +1023,70 @@ func (v *setApiIpAddressesResponse) GetOrganizationApiIpAllowlistUpdate() setApi return v.OrganizationApiIpAllowlistUpdate } -// updateClusterClusterCreateClusterCreatePayload includes the requested fields of the GraphQL type ClusterCreatePayload. +// updateClusterClusterUpdateClusterUpdatePayload includes the requested fields of the GraphQL type ClusterUpdatePayload. // The GraphQL type's documentation follows. // -// Autogenerated return type of ClusterCreate. -type updateClusterClusterCreateClusterCreatePayload struct { +// Autogenerated return type of ClusterUpdate. +type updateClusterClusterUpdateClusterUpdatePayload struct { // A unique identifier for the client performing the mutation. - ClientMutationId string `json:"clientMutationId"` + ClientMutationId string `json:"clientMutationId"` + Cluster updateClusterClusterUpdateClusterUpdatePayloadCluster `json:"cluster"` } -// GetClientMutationId returns updateClusterClusterCreateClusterCreatePayload.ClientMutationId, and is useful for accessing the field via an interface. -func (v *updateClusterClusterCreateClusterCreatePayload) GetClientMutationId() string { +// GetClientMutationId returns updateClusterClusterUpdateClusterUpdatePayload.ClientMutationId, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayload) GetClientMutationId() string { return v.ClientMutationId } +// GetCluster returns updateClusterClusterUpdateClusterUpdatePayload.Cluster, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayload) GetCluster() updateClusterClusterUpdateClusterUpdatePayloadCluster { + return v.Cluster +} + +// updateClusterClusterUpdateClusterUpdatePayloadCluster includes the requested fields of the GraphQL type Cluster. +type updateClusterClusterUpdateClusterUpdatePayloadCluster struct { + Id string `json:"id"` + // The public UUID for this cluster + Uuid string `json:"uuid"` + // Name of the cluster + Name string `json:"name"` + // Description of the cluster + Description string `json:"description"` + // Emoji for the cluster using Buildkite emoji syntax + Emoji string `json:"emoji"` + // Color hex code for the cluster + Color string `json:"color"` +} + +// GetId returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Id, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetId() string { return v.Id } + +// GetUuid returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Uuid, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetUuid() string { return v.Uuid } + +// GetName returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Name, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetName() string { return v.Name } + +// GetDescription returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Description, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetDescription() string { + return v.Description +} + +// GetEmoji returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Emoji, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetEmoji() string { return v.Emoji } + +// GetColor returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Color, and is useful for accessing the field via an interface. +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetColor() string { return v.Color } + // updateClusterResponse is returned by updateCluster on success. type updateClusterResponse struct { - // Create a cluster. - ClusterCreate updateClusterClusterCreateClusterCreatePayload `json:"clusterCreate"` + // Updates a cluster. + ClusterUpdate updateClusterClusterUpdateClusterUpdatePayload `json:"clusterUpdate"` } -// GetClusterCreate returns updateClusterResponse.ClusterCreate, and is useful for accessing the field via an interface. -func (v *updateClusterResponse) GetClusterCreate() updateClusterClusterCreateClusterCreatePayload { - return v.ClusterCreate +// GetClusterUpdate returns updateClusterResponse.ClusterUpdate, and is useful for accessing the field via an interface. +func (v *updateClusterResponse) GetClusterUpdate() updateClusterClusterUpdateClusterUpdatePayload { + return v.ClusterUpdate } // updatePipelinePipelineUpdatePipelineUpdatePayload includes the requested fields of the GraphQL type PipelineUpdatePayload. @@ -1792,9 +1837,17 @@ func setApiIpAddresses( // The query or mutation executed by updateCluster. const updateCluster_Operation = ` -mutation updateCluster ($organizationId: ID!, $name: String!, $description: String, $emoji: String, $color: String) { - clusterCreate(input: {organizationId:$organizationId,name:$name,description:$description,emoji:$emoji,color:$color}) { +mutation updateCluster ($organizationId: ID!, $id: ID!, $name: String, $description: String, $emoji: String, $color: String) { + clusterUpdate(input: {organizationId:$organizationId,id:$id,name:$name,description:$description,emoji:$emoji,color:$color}) { clientMutationId + cluster { + id + uuid + name + description + emoji + color + } } } ` @@ -1802,6 +1855,7 @@ mutation updateCluster ($organizationId: ID!, $name: String!, $description: Stri func updateCluster( client graphql.Client, organizationId string, + id string, name string, description string, emoji string, @@ -1812,6 +1866,7 @@ func updateCluster( Query: updateCluster_Operation, Variables: &__updateClusterInput{ OrganizationId: organizationId, + Id: id, Name: name, Description: description, Emoji: emoji, diff --git a/buildkite/graphql/cluster.graphql b/buildkite/graphql/cluster.graphql index e998378e..ff22ba27 100644 --- a/buildkite/graphql/cluster.graphql +++ b/buildkite/graphql/cluster.graphql @@ -48,11 +48,33 @@ mutation createCluster($organizationId: ID!, $name: String!, $description: Strin } } -mutation updateCluster($organizationId: ID!, $name: String!, $description: String, $emoji: String, $color: String) { - clusterCreate( - input: { organizationId: $organizationId, name: $name, description: $description, emoji: $emoji, color: $color } +mutation updateCluster( + $organizationId: ID! + $id: ID! + $name: String + $description: String + $emoji: String + $color: String +) { + clusterUpdate( + input: { + organizationId: $organizationId + id: $id + name: $name + description: $description + emoji: $emoji + color: $color + } ) { clientMutationId + cluster { + id + uuid + name + description + emoji + color + } } } diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index ceb111ce..1133c56f 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -70,8 +70,8 @@ func (c *ClusterResource) Schema(ctx context.Context, req resource.SchemaRequest } func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var data ClusterResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + var state *ClusterResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &state)...) if resp.Diagnostics.HasError() { return @@ -80,10 +80,10 @@ func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest r, err := createCluster( c.client.genqlient, c.client.organizationId, - data.Name.ValueString(), - data.Description.ValueString(), - data.Emoji.ValueString(), - data.Color.ValueString(), + state.Name.ValueString(), + state.Description.ValueString(), + state.Emoji.ValueString(), + state.Color.ValueString(), ) if err != nil { @@ -94,22 +94,22 @@ func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest return } - data.ID = types.StringValue(r.ClusterCreate.Cluster.Id) - data.UUID = types.StringValue(r.ClusterCreate.Cluster.Uuid) + state.ID = types.StringValue(r.ClusterCreate.Cluster.Id) + state.UUID = types.StringValue(r.ClusterCreate.Cluster.Uuid) - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var data ClusterResourceModel + var state ClusterResourceModel - resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) if resp.Diagnostics.HasError() { return } - cluster, err := getCluster(c.client.genqlient, c.client.organization, data.ID.ValueString()) + _, err := getCluster(c.client.genqlient, c.client.organization, state.UUID.ValueString()) if err != nil { resp.Diagnostics.AddError( @@ -119,53 +119,56 @@ func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, re return } - data.ID = types.StringValue(cluster.Organization.Cluster.Id) - data.Name = types.StringValue(cluster.Organization.Cluster.Name) - data.Description = types.StringValue(cluster.Organization.Cluster.Description) - data.UUID = types.StringValue(cluster.Organization.Cluster.Uuid) - - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var data ClusterResourceModel + var state ClusterResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + resp.Diagnostics.Append(req.Plan.Get(ctx, &state)...) if resp.Diagnostics.HasError() { return } - _, err := updateCluster( + id := state.ID.ValueString() + + fmt.Println("ID: ", id) + + r, _ := updateCluster( c.client.genqlient, c.client.organizationId, - data.Name.ValueString(), - data.Description.ValueString(), - data.Emoji.ValueString(), - data.Color.ValueString(), + id, + state.Name.ValueString(), + state.Description.ValueString(), + state.Emoji.ValueString(), + state.Color.ValueString(), ) - if err != nil { - resp.Diagnostics.AddError( - "Unable to update Cluster", - fmt.Sprintf("Unable to update Cluster: %s", err.Error()), - ) - return - } + // if err != nil { + // resp.Diagnostics.AddError( + // "Unable to update Cluster", + // fmt.Sprintf("Unable to update Cluster: %s", err.Error()), + // ) + // return + // } + + state.ID = types.StringValue(id) + state.UUID = types.StringValue(r.ClusterUpdate.Cluster.Uuid) - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } func (c *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var data ClusterResourceModel + var state ClusterResourceModel - resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) if resp.Diagnostics.HasError() { return } - _, err := deleteCluster(c.client.genqlient, c.client.organizationId, data.ID.ValueString()) + _, err := deleteCluster(c.client.genqlient, c.client.organizationId, state.ID.ValueString()) if err != nil { resp.Diagnostics.AddError( diff --git a/schema.graphql b/schema.graphql index 1fd3a519..6e4e7b46 100644 --- a/schema.graphql +++ b/schema.graphql @@ -546,6 +546,8 @@ union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | A """All the possible types of subjects in an Audit Event""" enum AuditSubjectType { + SSO_PROVIDER + ORGANIZATION_MEMBER AGENT_TOKEN API_ACCESS_TOKEN CLUSTER_QUEUE @@ -554,19 +556,17 @@ enum AuditSubjectType { ORGANIZATION ORGANIZATION_INVITATION PIPELINE_SCHEDULE - ORGANIZATION_MEMBER + TEAM TEAM_MEMBER TEAM_PIPELINE - TEAM + TEAM_SUITE SCM_SERVICE SCM_PIPELINE_SETTINGS - TEAM_SUITE SCM_REPOSITORY_HOST SUITE_MONITOR SUITE - USER_EMAIL - SSO_PROVIDER USER + USER_EMAIL USER_TOTP CLUSTER CLUSTER_PERMISSION diff --git a/tf-proj/main.tf b/tf-proj/main.tf index dfd507c8..fe90d726 100644 --- a/tf-proj/main.tf +++ b/tf-proj/main.tf @@ -13,6 +13,6 @@ provider "buildkite" { resource "buildkite_cluster" "test_cluster" { - name = "test-cluster" + name = "cluster-test-2" description = "test cluster" } From 1cb1929f9380270f5fe8ac586fe3e87ef8a79999 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Thu, 22 Jun 2023 15:46:10 +1000 Subject: [PATCH 07/37] CRUD for Clusters --- buildkite/resource_cluster.go | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 1133c56f..62b15bfc 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -123,9 +123,10 @@ func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, re } func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var state ClusterResourceModel + var state, plan ClusterResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &state)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) if resp.Diagnostics.HasError() { return @@ -135,28 +136,27 @@ func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest fmt.Println("ID: ", id) - r, _ := updateCluster( + _, err := updateCluster( c.client.genqlient, c.client.organizationId, id, - state.Name.ValueString(), - state.Description.ValueString(), - state.Emoji.ValueString(), - state.Color.ValueString(), + plan.Name.ValueString(), + plan.Description.ValueString(), + plan.Emoji.ValueString(), + plan.Color.ValueString(), ) - // if err != nil { - // resp.Diagnostics.AddError( - // "Unable to update Cluster", - // fmt.Sprintf("Unable to update Cluster: %s", err.Error()), - // ) - // return - // } - - state.ID = types.StringValue(id) - state.UUID = types.StringValue(r.ClusterUpdate.Cluster.Uuid) + if err != nil { + resp.Diagnostics.AddError( + "Unable to update Cluster", + fmt.Sprintf("Unable to update Cluster: %s", err.Error()), + ) + return + } - resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) + plan.ID = state.ID + plan.UUID = state.UUID + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) } func (c *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { From 19e1a5790fcfd174add1f6c256d0b769958ccb32 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Thu, 22 Jun 2023 17:04:56 +1000 Subject: [PATCH 08/37] Cluster resource tests --- buildkite/resource_cluster_test.go | 106 +++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 buildkite/resource_cluster_test.go diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go new file mode 100644 index 00000000..2f982533 --- /dev/null +++ b/buildkite/resource_cluster_test.go @@ -0,0 +1,106 @@ +package buildkite + +import ( + "fmt" + "os" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func testAccClusterBasic(name string) string { + config := ` + resource "buildkite_cluster" "test_cluster" { + name = "%s_test_cluster" + description = "Test cluster" + } + ` + return fmt.Sprintf(config, name) +} + +func TestAccCluster_AddRemove(t *testing.T) { + t.Parallel() + var c ClusterResourceModel + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: protoV6ProviderFactories(), + CheckDestroy: testAccCheckClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccClusterBasic("foo"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckClusterRemoteValues(c.ID.ValueString()), + ), + }, + { + RefreshState: true, + PlanOnly: true, + Check: resource.ComposeAggregateTestCheckFunc( + // Confirm the token has the correct values in terraform state + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "name"), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "description"), + ), + }, + }, + }) +} + +func TestAccCluster_Update(t *testing.T) { + t.Parallel() + var c ClusterResourceModel + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: protoV6ProviderFactories(), + CheckDestroy: testAccCheckClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccClusterBasic("bar"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckClusterRemoteValues(c.ID.ValueString()), + resource.TestCheckResourceAttr("buildkite_cluster.bar", "name", "bar_test_cluster"), + ), + }, + { + Config: testAccClusterBasic("baz"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckClusterRemoteValues(c.ID.ValueString()), + resource.TestCheckResourceAttr("buildkite_cluster.baz", "name", "baz_test_cluster"), + ), + }, + }, + }) +} + +func testAccCheckClusterRemoteValues(id string) resource.TestCheckFunc { + return func(s *terraform.State) error { + resp, err := getCluster(genqlientGraphql, os.Getenv("BUILDKITE_ORGANIZATION"), id) + + if err != nil { + return err + } + + if resp.Organization.Cluster.Name != id { + return fmt.Errorf("Cluster name does not match") + } + return nil + } +} + +func testAccCheckClusterDestroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "buildkite_cluster" { + continue + } + + _, err := getCluster(genqlientGraphql, os.Getenv("BUILDKITE_ORGANIZATION"), rs.Primary.ID) + + if err == nil { + return fmt.Errorf("Cluster still exists") + } + } + + return nil +} From 1ddf4f537a8658b1eed38b15474c9982dc6311ad Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Fri, 23 Jun 2023 11:25:44 +1000 Subject: [PATCH 09/37] Use a planmodifier to maintain state for ID and UUID --- buildkite/resource_cluster.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 62b15bfc..21c1e002 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -6,6 +6,8 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" resource_schema "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -45,9 +47,15 @@ func (c *ClusterResource) Schema(ctx context.Context, req resource.SchemaRequest Attributes: map[string]resource_schema.Attribute{ "id": resource_schema.StringAttribute{ Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, }, "uuid": resource_schema.StringAttribute{ Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, }, "name": resource_schema.StringAttribute{ MarkdownDescription: "The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.", @@ -154,8 +162,8 @@ func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest return } - plan.ID = state.ID - plan.UUID = state.UUID + // plan.ID = state.ID + // plan.UUID = state.UUID resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) } From 1044dedf4ed75d13e6ba0ab3decf86eac1414479 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 28 Jun 2023 16:47:56 +1000 Subject: [PATCH 10/37] Bit of clean up. --- buildkite/resource_cluster.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 21c1e002..d66e29f7 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -142,8 +142,6 @@ func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest id := state.ID.ValueString() - fmt.Println("ID: ", id) - _, err := updateCluster( c.client.genqlient, c.client.organizationId, @@ -162,8 +160,6 @@ func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest return } - // plan.ID = state.ID - // plan.UUID = state.UUID resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) } From 0de13926528e8ed5ec24f66930e5541efebfafcd Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 28 Jun 2023 21:51:23 +1000 Subject: [PATCH 11/37] Fix some testing typos. --- buildkite/resource_cluster_test.go | 11 +++++------ tf-proj/main.tf | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 2f982533..d7078b0b 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -11,7 +11,7 @@ import ( func testAccClusterBasic(name string) string { config := ` - resource "buildkite_cluster" "test_cluster" { + resource "buildkite_cluster" "foo" { name = "%s_test_cluster" description = "Test cluster" } @@ -38,7 +38,6 @@ func TestAccCluster_AddRemove(t *testing.T) { RefreshState: true, PlanOnly: true, Check: resource.ComposeAggregateTestCheckFunc( - // Confirm the token has the correct values in terraform state resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "name"), resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "description"), ), @@ -60,14 +59,14 @@ func TestAccCluster_Update(t *testing.T) { Config: testAccClusterBasic("bar"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterRemoteValues(c.ID.ValueString()), - resource.TestCheckResourceAttr("buildkite_cluster.bar", "name", "bar_test_cluster"), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "bar_test_cluster"), ), }, { Config: testAccClusterBasic("baz"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterRemoteValues(c.ID.ValueString()), - resource.TestCheckResourceAttr("buildkite_cluster.baz", "name", "baz_test_cluster"), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), ), }, }, @@ -76,7 +75,7 @@ func TestAccCluster_Update(t *testing.T) { func testAccCheckClusterRemoteValues(id string) resource.TestCheckFunc { return func(s *terraform.State) error { - resp, err := getCluster(genqlientGraphql, os.Getenv("BUILDKITE_ORGANIZATION"), id) + resp, err := getCluster(genqlientGraphql, os.Getenv("BUILDKITE_ORGANIZATION_SLUG"), id) if err != nil { return err @@ -95,7 +94,7 @@ func testAccCheckClusterDestroy(s *terraform.State) error { continue } - _, err := getCluster(genqlientGraphql, os.Getenv("BUILDKITE_ORGANIZATION"), rs.Primary.ID) + _, err := getCluster(genqlientGraphql, os.Getenv("BUILDKITE_ORGANIZATION_SLUG"), rs.Primary.ID) if err == nil { return fmt.Errorf("Cluster still exists") diff --git a/tf-proj/main.tf b/tf-proj/main.tf index fe90d726..310a8f02 100644 --- a/tf-proj/main.tf +++ b/tf-proj/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { buildkite = { source = "buildkite/buildkite" - version = "0.19.0" + version = "0.19.2" } } } @@ -13,6 +13,6 @@ provider "buildkite" { resource "buildkite_cluster" "test_cluster" { - name = "cluster-test-2" + name = "cluster-test" description = "test cluster" } From d1257ebc19532bd7a802cca6f1de162cc90ee067 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 28 Jun 2023 21:52:56 +1000 Subject: [PATCH 12/37] Add gotest --- go.mod | 6 ++++++ go.sum | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/go.mod b/go.mod index 8b21c15c..762c83f9 100644 --- a/go.mod +++ b/go.mod @@ -17,9 +17,12 @@ require ( github.com/alexflint/go-arg v1.4.2 // indirect github.com/alexflint/go-scalar v1.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/dnephin/pflag v1.0.7 // indirect github.com/fatih/color v1.13.0 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.9 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -56,7 +59,9 @@ require ( golang.org/x/crypto v0.7.0 // indirect golang.org/x/mod v0.10.0 // indirect golang.org/x/net v0.9.0 // indirect + golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -64,4 +69,5 @@ require ( google.golang.org/grpc v1.54.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gotest.tools/gotestsum v1.10.0 // indirect ) diff --git a/go.sum b/go.sum index 69d54737..6959220a 100644 --- a/go.sum +++ b/go.sum @@ -34,12 +34,16 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= +github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= @@ -58,8 +62,11 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= @@ -161,6 +168,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -169,6 +177,7 @@ github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f h1:tygelZueB1EtXk github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -188,18 +197,25 @@ github.com/vektah/gqlparser/v2 v2.5.1/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRF github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -207,6 +223,7 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= @@ -214,15 +231,22 @@ golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -231,25 +255,35 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= @@ -257,11 +291,15 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -291,3 +329,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/gotestsum v1.10.0 h1:lVO4uQJoxdsJb7jgmr1fg8QW7zGQ/tuqvsq5fHKyoHQ= +gotest.tools/gotestsum v1.10.0/go.mod h1:6JHCiN6TEjA7Kaz23q1bH0e2Dc3YJjDUZ0DmctFZf+w= +gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= From fa0d1676ba88fc085bae9e4ac715c71190032306 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 28 Jun 2023 22:06:05 +1000 Subject: [PATCH 13/37] Destroy test refactor. --- buildkite/resource_cluster_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index d7078b0b..7b016102 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -1,6 +1,7 @@ package buildkite import ( + "context" "fmt" "os" "testing" @@ -94,12 +95,22 @@ func testAccCheckClusterDestroy(s *terraform.State) error { continue } - _, err := getCluster(genqlientGraphql, os.Getenv("BUILDKITE_ORGANIZATION_SLUG"), rs.Primary.ID) + var getClusterQuery struct { + Organization struct { + Cluster struct { + ID string `graphql:"id"` + } + } + } + + err := graphqlClient.Query(context.Background(), &getClusterQuery, map[string]interface{}{ + "id": rs.Primary.ID, + }) if err == nil { return fmt.Errorf("Cluster still exists") } + return nil } - return nil } From f5e9ccd6d3da668d7c572b36e040877781af39f9 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 28 Jun 2023 22:30:04 +1000 Subject: [PATCH 14/37] GraphQL fragments. --- buildkite/generated.go | 245 +- buildkite/graphql/cluster.graphql | 19 +- buildkite/resource_cluster_test.go | 57 +- schema.graphql | 12951 ++++++++++----------------- 4 files changed, 4922 insertions(+), 8350 deletions(-) diff --git a/buildkite/generated.go b/buildkite/generated.go index 440f6cb1..ea7d63d0 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -3,6 +3,8 @@ package buildkite import ( + "encoding/json" + "github.com/Khan/genqlient/graphql" ) @@ -26,6 +28,39 @@ const ( BuildRetentionPeriodsYears2 BuildRetentionPeriods = "YEARS_2" ) +// ClusterValues includes the GraphQL fields of Cluster requested by the fragment ClusterValues. +type ClusterValues struct { + Id string `json:"id"` + // The public UUID for this cluster + Uuid string `json:"uuid"` + // Name of the cluster + Name string `json:"name"` + // Description of the cluster + Description string `json:"description"` + // Emoji for the cluster using Buildkite emoji syntax + Emoji string `json:"emoji"` + // Color hex code for the cluster + Color string `json:"color"` +} + +// GetId returns ClusterValues.Id, and is useful for accessing the field via an interface. +func (v *ClusterValues) GetId() string { return v.Id } + +// GetUuid returns ClusterValues.Uuid, and is useful for accessing the field via an interface. +func (v *ClusterValues) GetUuid() string { return v.Uuid } + +// GetName returns ClusterValues.Name, and is useful for accessing the field via an interface. +func (v *ClusterValues) GetName() string { return v.Name } + +// GetDescription returns ClusterValues.Description, and is useful for accessing the field via an interface. +func (v *ClusterValues) GetDescription() string { return v.Description } + +// GetEmoji returns ClusterValues.Emoji, and is useful for accessing the field via an interface. +func (v *ClusterValues) GetEmoji() string { return v.Emoji } + +// GetColor returns ClusterValues.Color, and is useful for accessing the field via an interface. +func (v *ClusterValues) GetColor() string { return v.Color } + // The roles a user can be within a team type GTeamMemberRole string @@ -525,16 +560,97 @@ func (v *createClusterClusterCreateClusterCreatePayload) GetCluster() createClus // createClusterClusterCreateClusterCreatePayloadCluster includes the requested fields of the GraphQL type Cluster. type createClusterClusterCreateClusterCreatePayloadCluster struct { - Id string `json:"id"` - // The public UUID for this cluster - Uuid string `json:"uuid"` + ClusterValues `json:"-"` } // GetId returns createClusterClusterCreateClusterCreatePayloadCluster.Id, and is useful for accessing the field via an interface. -func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetId() string { return v.Id } +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetId() string { + return v.ClusterValues.Id +} // GetUuid returns createClusterClusterCreateClusterCreatePayloadCluster.Uuid, and is useful for accessing the field via an interface. -func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetUuid() string { return v.Uuid } +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetUuid() string { + return v.ClusterValues.Uuid +} + +// GetName returns createClusterClusterCreateClusterCreatePayloadCluster.Name, and is useful for accessing the field via an interface. +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetName() string { + return v.ClusterValues.Name +} + +// GetDescription returns createClusterClusterCreateClusterCreatePayloadCluster.Description, and is useful for accessing the field via an interface. +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetDescription() string { + return v.ClusterValues.Description +} + +// GetEmoji returns createClusterClusterCreateClusterCreatePayloadCluster.Emoji, and is useful for accessing the field via an interface. +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetEmoji() string { + return v.ClusterValues.Emoji +} + +// GetColor returns createClusterClusterCreateClusterCreatePayloadCluster.Color, and is useful for accessing the field via an interface. +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetColor() string { + return v.ClusterValues.Color +} + +func (v *createClusterClusterCreateClusterCreatePayloadCluster) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *createClusterClusterCreateClusterCreatePayloadCluster + graphql.NoUnmarshalJSON + } + firstPass.createClusterClusterCreateClusterCreatePayloadCluster = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ClusterValues) + if err != nil { + return err + } + return nil +} + +type __premarshalcreateClusterClusterCreateClusterCreatePayloadCluster struct { + Id string `json:"id"` + + Uuid string `json:"uuid"` + + Name string `json:"name"` + + Description string `json:"description"` + + Emoji string `json:"emoji"` + + Color string `json:"color"` +} + +func (v *createClusterClusterCreateClusterCreatePayloadCluster) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *createClusterClusterCreateClusterCreatePayloadCluster) __premarshalJSON() (*__premarshalcreateClusterClusterCreateClusterCreatePayloadCluster, error) { + var retval __premarshalcreateClusterClusterCreateClusterCreatePayloadCluster + + retval.Id = v.ClusterValues.Id + retval.Uuid = v.ClusterValues.Uuid + retval.Name = v.ClusterValues.Name + retval.Description = v.ClusterValues.Description + retval.Emoji = v.ClusterValues.Emoji + retval.Color = v.ClusterValues.Color + return &retval, nil +} // createClusterResponse is returned by createCluster on success. type createClusterResponse struct { @@ -1078,38 +1194,97 @@ func (v *updateClusterClusterUpdateClusterUpdatePayload) GetCluster() updateClus // updateClusterClusterUpdateClusterUpdatePayloadCluster includes the requested fields of the GraphQL type Cluster. type updateClusterClusterUpdateClusterUpdatePayloadCluster struct { - Id string `json:"id"` - // The public UUID for this cluster - Uuid string `json:"uuid"` - // Name of the cluster - Name string `json:"name"` - // Description of the cluster - Description string `json:"description"` - // Emoji for the cluster using Buildkite emoji syntax - Emoji string `json:"emoji"` - // Color hex code for the cluster - Color string `json:"color"` + ClusterValues `json:"-"` } // GetId returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Id, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetId() string { return v.Id } +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetId() string { + return v.ClusterValues.Id +} // GetUuid returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Uuid, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetUuid() string { return v.Uuid } +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetUuid() string { + return v.ClusterValues.Uuid +} // GetName returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Name, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetName() string { return v.Name } +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetName() string { + return v.ClusterValues.Name +} // GetDescription returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Description, and is useful for accessing the field via an interface. func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetDescription() string { - return v.Description + return v.ClusterValues.Description } // GetEmoji returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Emoji, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetEmoji() string { return v.Emoji } +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetEmoji() string { + return v.ClusterValues.Emoji +} // GetColor returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Color, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetColor() string { return v.Color } +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetColor() string { + return v.ClusterValues.Color +} + +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *updateClusterClusterUpdateClusterUpdatePayloadCluster + graphql.NoUnmarshalJSON + } + firstPass.updateClusterClusterUpdateClusterUpdatePayloadCluster = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ClusterValues) + if err != nil { + return err + } + return nil +} + +type __premarshalupdateClusterClusterUpdateClusterUpdatePayloadCluster struct { + Id string `json:"id"` + + Uuid string `json:"uuid"` + + Name string `json:"name"` + + Description string `json:"description"` + + Emoji string `json:"emoji"` + + Color string `json:"color"` +} + +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) __premarshalJSON() (*__premarshalupdateClusterClusterUpdateClusterUpdatePayloadCluster, error) { + var retval __premarshalupdateClusterClusterUpdateClusterUpdatePayloadCluster + + retval.Id = v.ClusterValues.Id + retval.Uuid = v.ClusterValues.Uuid + retval.Name = v.ClusterValues.Name + retval.Description = v.ClusterValues.Description + retval.Emoji = v.ClusterValues.Emoji + retval.Color = v.ClusterValues.Color + return &retval, nil +} // updateClusterResponse is returned by updateCluster on success. type updateClusterResponse struct { @@ -1524,11 +1699,18 @@ mutation createCluster ($organizationId: ID!, $name: String!, $description: Stri clusterCreate(input: {organizationId:$organizationId,name:$name,description:$description,emoji:$emoji,color:$color}) { clientMutationId cluster { - id - uuid + ... ClusterValues } } } +fragment ClusterValues on Cluster { + id + uuid + name + description + emoji + color +} ` func createCluster( @@ -1908,15 +2090,18 @@ mutation updateCluster ($organizationId: ID!, $id: ID!, $name: String, $descript clusterUpdate(input: {organizationId:$organizationId,id:$id,name:$name,description:$description,emoji:$emoji,color:$color}) { clientMutationId cluster { - id - uuid - name - description - emoji - color + ... ClusterValues } } } +fragment ClusterValues on Cluster { + id + uuid + name + description + emoji + color +} ` func updateCluster( diff --git a/buildkite/graphql/cluster.graphql b/buildkite/graphql/cluster.graphql index ff22ba27..5151a758 100644 --- a/buildkite/graphql/cluster.graphql +++ b/buildkite/graphql/cluster.graphql @@ -1,3 +1,12 @@ +fragment ClusterValues on Cluster { + id + uuid + name + description + emoji + color +} + query getCluster($orgSlug: ID!, $id: ID!) { organization(slug: $orgSlug) { cluster(id: $id) { @@ -42,8 +51,7 @@ mutation createCluster($organizationId: ID!, $name: String!, $description: Strin ) { clientMutationId cluster { - id - uuid + ...ClusterValues } } } @@ -68,12 +76,7 @@ mutation updateCluster( ) { clientMutationId cluster { - id - uuid - name - description - emoji - color + ...ClusterValues } } } diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 7b016102..85f22fc4 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -3,9 +3,10 @@ package buildkite import ( "context" "fmt" - "os" "testing" + "github.com/hashicorp/terraform-plugin-framework/providerserver" + "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -20,19 +21,25 @@ func testAccClusterBasic(name string) string { return fmt.Sprintf(config, name) } +func protoV5ProviderFactories() map[string]func() (tfprotov5.ProviderServer, error) { + return map[string]func() (tfprotov5.ProviderServer, error){ + "buildkite": providerserver.NewProtocol5WithError(New("testing")), + } +} + func TestAccCluster_AddRemove(t *testing.T) { t.Parallel() var c ClusterResourceModel resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: protoV6ProviderFactories(), + ProtoV5ProviderFactories: protoV5ProviderFactories(), CheckDestroy: testAccCheckClusterDestroy, Steps: []resource.TestStep{ { Config: testAccClusterBasic("foo"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterRemoteValues(c.ID.ValueString()), + testAccCheckClusterRemoteValues(&c, "Test cluster"), ), }, { @@ -53,20 +60,20 @@ func TestAccCluster_Update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: protoV6ProviderFactories(), + ProtoV5ProviderFactories: protoV5ProviderFactories(), CheckDestroy: testAccCheckClusterDestroy, Steps: []resource.TestStep{ { Config: testAccClusterBasic("bar"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterRemoteValues(c.ID.ValueString()), + testAccCheckClusterExists("buildkite_cluster.foo", &c), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "bar_test_cluster"), ), }, { Config: testAccClusterBasic("baz"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterRemoteValues(c.ID.ValueString()), + testAccCheckClusterExists("buildkite_cluster.foo", &c), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), ), }, @@ -74,16 +81,46 @@ func TestAccCluster_Update(t *testing.T) { }) } -func testAccCheckClusterRemoteValues(id string) resource.TestCheckFunc { +func testAccCheckClusterExists(n string, c *ClusterResourceModel) resource.TestCheckFunc { return func(s *terraform.State) error { - resp, err := getCluster(genqlientGraphql, os.Getenv("BUILDKITE_ORGANIZATION_SLUG"), id) + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("cluster not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("no cluster ID is set") + } + + var getClusterQuery struct { + Organization struct { + Cluster struct { + ID string `graphql:"id"` + } + } + } + + err := graphqlClient.Query(context.Background(), &getClusterQuery, map[string]interface{}{ + "id": rs.Primary.ID, + }) if err != nil { return err } - if resp.Organization.Cluster.Name != id { - return fmt.Errorf("Cluster name does not match") + if getClusterQuery.Organization.Cluster.ID != rs.Primary.ID { + return fmt.Errorf("cluster not found") + } + + return nil + } +} + +func testAccCheckClusterRemoteValues(c *ClusterResourceModel, description string) resource.TestCheckFunc { + return func(s *terraform.State) error { + + if string(c.Description.ValueString()) != description { + return fmt.Errorf("unexpected description: %s", c.Description) } return nil } diff --git a/schema.graphql b/schema.graphql index 2dadcb92..f109f9a9 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,9179 +1,5526 @@ -""" -Directs the executor to include this field or fragment only when the `if` argument is true. -""" +"""Directs the executor to include this field or fragment only when the `if` argument is true.""" directive @include( - """ - Included when true. - """ - if: Boolean! +"""Included when true.""" + if: Boolean! ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT -""" -Directs the executor to skip this field or fragment when the `if` argument is true. -""" +"""Directs the executor to skip this field or fragment when the `if` argument is true.""" directive @skip( - """ - Skipped when true. - """ - if: Boolean! +"""Skipped when true.""" + if: Boolean! ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT -""" -Marks an element of a GraphQL schema as no longer supported. -""" +"""Marks an element of a GraphQL schema as no longer supported.""" directive @deprecated( - """ - Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/). - """ - reason: String +"""Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).""" + reason: String ) on FIELD_DEFINITION | ENUM_VALUE | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION -""" -Requires that exactly one field must be supplied and that field must not be `null`. -""" +"""Requires that exactly one field must be supplied and that field must not be `null`.""" directive @oneOf on INPUT_OBJECT -""" -API access tokens for authentication with the Buildkite API -""" -type APIAccessToken implements Node { - id: ID! - """ - The public UUID for the API Access Token - """ - uuid: ID! -} - -""" -A code that is used by an API Application to request an API Access Token -""" -type APIAccessTokenCode implements Node { - application: APIApplication - """ - The time when this code was authorized by a user - """ - authorizedAt: DateTime - """ - The IP address of the client that authorized this code - """ - authorizedIPAddress: String - """ - The actual code used to find this API Access Token Code record - """ - code: String! - """ - The description of the code provided by the API Application - """ - description: String! - """ - The time when this code will expire - """ - expiresAt: DateTime! - id: ID! -} - -""" -Autogenerated input type of APIAccessTokenCodeAuthorizeMutation -""" +"""API access tokens for authentication with the Buildkite API""" +type APIAccessToken implements Node{ + id: ID! +"""The public UUID for the API Access Token""" + uuid: ID! +} + +"""A code that is used by an API Application to request an API Access Token""" +type APIAccessTokenCode implements Node{ + application: APIApplication +"""The time when this code was authorized by a user""" + authorizedAt: DateTime +"""The IP address of the client that authorized this code""" + authorizedIPAddress: String +"""The actual code used to find this API Access Token Code record""" + code: String! +"""The description of the code provided by the API Application""" + description: String! +"""The time when this code will expire""" + expiresAt: DateTime! + id: ID! +} + +"""Autogenerated input type of APIAccessTokenCodeAuthorizeMutation""" input APIAccessTokenCodeAuthorizeMutationInput { - """ - Autogenerated input type of APIAccessTokenCodeAuthorizeMutation - """ - clientMutationId: String - """ - Autogenerated input type of APIAccessTokenCodeAuthorizeMutation - """ - id: ID! +"""Autogenerated input type of APIAccessTokenCodeAuthorizeMutation""" + clientMutationId: String +"""Autogenerated input type of APIAccessTokenCodeAuthorizeMutation""" + id: ID! } -""" -Autogenerated return type of APIAccessTokenCodeAuthorizeMutation. -""" +"""Autogenerated return type of APIAccessTokenCodeAuthorizeMutation.""" type APIAccessTokenCodeAuthorizeMutationPayload { - apiAccessTokenCode: APIAccessTokenCode! - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String + apiAccessTokenCode: APIAccessTokenCode! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String } -""" -All possible scopes on a user's API Access Token -""" +"""All possible scopes on a user's API Access Token""" enum APIAccessTokenScopes { - GRAPHQL - READ_AGENTS - READ_ARTIFACTS - READ_BUILD_LOGS - READ_BUILDS - READ_CLUSTERS - READ_FLAKY_TESTS - READ_JOB_ENV - READ_NOTIFICATION_SERVICES - READ_ORGANIZATIONS - READ_PIPELINES - READ_SUITES - READ_TEAMS - READ_USER - WRITE_AGENTS - WRITE_ARTIFACTS - WRITE_BUILD_LOGS - WRITE_BUILDS - WRITE_CLUSTERS - WRITE_NOTIFICATION_SERVICES - WRITE_PIPELINES - WRITE_SUITES -} - -""" -An API Application -""" -type APIApplication implements Node { - """ - A description of the application - """ - description: String! - id: ID! - """ - The name of this application - """ - name: String! -} - -""" -An agent -""" -type Agent implements Node { - clusterQueue: ClusterQueue - """ - The time when the agent connected to Buildkite - """ - connectedAt: DateTime - """ - The connection state of the agent - """ - connectionState: String! - """ - The date the agent was created - """ - createdAt: DateTime - """ - The time when the agent disconnected from Buildkite - """ - disconnectedAt: DateTime - """ - The last time the agent performed a `heartbeat` operation to the Agent API - """ - heartbeatAt: DateTime - """ - The hostname of the machine running the agent - """ - hostname: String - id: ID! - """ - The IP address that the agent has connected from - """ - ipAddress: String - """ - If this version of agent has been deprecated by Buildkite - """ - isDeprecated: Boolean! - """ - Returns whether or not this agent is running a job. If isRunningJob true, but the `job` field is empty, the current user doesn't have access to view the job - """ - isRunningJob: Boolean! - """ - The currently running job - """ - job: Job - """ - Jobs that have been assigned to this agent - """ - jobs( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - type: [JobTypes!] - state: [JobStates!] - priority: Int - agentQueryRules: [String!] - concurrency: JobConcurrencySearch - """ - Whether or not the command job passed. Passing `false` will return all failed jobs (including "soft failed" jobs) - """ - passed: Boolean - """ - Filtering jobs based on related step information - """ - step: JobStepSearch - """ - Order the jobs - """ - order: JobOrder - ): JobConnection - """ - The date the agent was lost from Buildkite if it didn't cleanly disconnect - """ - lostAt: DateTime - """ - The meta data this agent was stared with - """ - metaData: [String!] - """ - The name of the agent - """ - name: String! - """ - The operating system the agent is running on - """ - operatingSystem: OperatingSystem - organization: Organization - permissions: AgentPermissions! - """ - The process identifier (PID) of the agent process on the machine - """ - pid: String - pingedAt: DateTime - """ - The priority setting for the agent - """ - priority: Int - """ - Whether this agent is visible to everyone, including people outside this organization - """ - public: Boolean! - """ - The time this agent was forced to stop - """ - stopForcedAt: DateTime - """ - The user that forced this agent to stop - """ - stopForcedBy: User - """ - The time the agent was first asked to stop - """ - stoppedAt: DateTime - """ - The user that initially stopped this agent - """ - stoppedBy: User - """ - The time the agent was gracefully stopped by a user - """ - stoppedGracefullyAt: DateTime - """ - The user that gracefully stopped this agent - """ - stoppedGracefullyBy: User - """ - The User-Agent of the program that is making Agent API requests to Buildkite - """ - userAgent: String - """ - The public UUID for the agent - """ - uuid: String! - """ - The version of the agent - """ - version: String - """ - Whether this agent's version has known issues and should be upgraded - """ - versionHasKnownIssues: Boolean! -} - -type AgentConnection implements Connection { - count: Int! - edges: [AgentEdge] - pageInfo: PageInfo + GRAPHQL + READ_AGENTS + READ_ARTIFACTS + READ_BUILD_LOGS + READ_BUILDS + READ_CLUSTERS + READ_FLAKY_TESTS + READ_JOB_ENV + READ_NOTIFICATION_SERVICES + READ_ORGANIZATIONS + READ_PIPELINES + READ_SUITES + READ_TEAMS + READ_USER + WRITE_AGENTS + WRITE_ARTIFACTS + WRITE_BUILD_LOGS + WRITE_BUILDS + WRITE_CLUSTERS + WRITE_NOTIFICATION_SERVICES + WRITE_PIPELINES + WRITE_SUITES +} + +"""An API Application""" +type APIApplication implements Node{ +"""A description of the application""" + description: String! + id: ID! +"""The name of this application""" + name: String! +} + +"""An agent""" +type Agent implements Node{ + clusterQueue: ClusterQueue +"""The time when the agent connected to Buildkite""" + connectedAt: DateTime +"""The connection state of the agent""" + connectionState: String! +"""The date the agent was created""" + createdAt: DateTime +"""The time when the agent disconnected from Buildkite""" + disconnectedAt: DateTime +"""The last time the agent performed a `heartbeat` operation to the Agent API""" + heartbeatAt: DateTime +"""The hostname of the machine running the agent""" + hostname: String + id: ID! +"""The IP address that the agent has connected from""" + ipAddress: String +"""If this version of agent has been deprecated by Buildkite""" + isDeprecated: Boolean! +"""Returns whether or not this agent is running a job. If isRunningJob true, but the `job` field is empty, the current user doesn't have access to view the job""" + isRunningJob: Boolean! +"""The currently running job""" + job: Job +"""Jobs that have been assigned to this agent""" + jobs( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + type: [JobTypes!] + state: [JobStates!] + priority: Int + agentQueryRules: [String!] + concurrency: JobConcurrencySearch +"""Whether or not the command job passed. Passing `false` will return all failed jobs (including "soft failed" jobs)""" + passed: Boolean +"""Filtering jobs based on related step information""" + step: JobStepSearch +"""Order the jobs""" + order: JobOrder + ): JobConnection +"""The date the agent was lost from Buildkite if it didn't cleanly disconnect""" + lostAt: DateTime +"""The meta data this agent was stared with""" + metaData: [String!] +"""The name of the agent""" + name: String! +"""The operating system the agent is running on""" + operatingSystem: OperatingSystem + organization: Organization + permissions: AgentPermissions! +"""The process identifier (PID) of the agent process on the machine""" + pid: String + pingedAt: DateTime +"""The priority setting for the agent""" + priority: Int +"""Whether this agent is visible to everyone, including people outside this organization""" + public: Boolean! +"""The time this agent was forced to stop""" + stopForcedAt: DateTime +"""The user that forced this agent to stop""" + stopForcedBy: User +"""The time the agent was first asked to stop""" + stoppedAt: DateTime +"""The user that initially stopped this agent""" + stoppedBy: User +"""The time the agent was gracefully stopped by a user""" + stoppedGracefullyAt: DateTime +"""The user that gracefully stopped this agent""" + stoppedGracefullyBy: User +"""The User-Agent of the program that is making Agent API requests to Buildkite""" + userAgent: String +"""The public UUID for the agent""" + uuid: String! +"""The version of the agent""" + version: String +"""Whether this agent's version has known issues and should be upgraded""" + versionHasKnownIssues: Boolean! +} + +type AgentConnection implements Connection{ + count: Int! + edges: [AgentEdge] + pageInfo: PageInfo } type AgentEdge { - cursor: String! - node: Agent + cursor: String! + node: Agent } -""" -Permissions information about what actions the current user can do against this agent -""" +"""Permissions information about what actions the current user can do against this agent""" type AgentPermissions { - """ - Whether the user can stop the agent remotely - """ - agentStop: Permission +"""Whether the user can stop the agent remotely""" + agentStop: Permission } -""" -Autogenerated input type of AgentStop -""" +"""Autogenerated input type of AgentStop""" input AgentStopInput { - """ - Autogenerated input type of AgentStop - """ - clientMutationId: String - """ - Autogenerated input type of AgentStop - """ - id: ID! - """ - Autogenerated input type of AgentStop - """ - graceful: Boolean +"""Autogenerated input type of AgentStop""" + clientMutationId: String +"""Autogenerated input type of AgentStop""" + id: ID! +"""Autogenerated input type of AgentStop""" + graceful: Boolean } -""" -Autogenerated return type of AgentStop. -""" +"""Autogenerated return type of AgentStop.""" type AgentStopPayload { - agent: Agent! - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String -} - -""" -A token used to connect an agent to Buildkite -""" -type AgentToken implements Node { - """ - The time this agent token was created - """ - createdAt: DateTime - """ - The user that created this agent token - """ - createdBy: User - """ - A description about what this agent token is used for - """ - description: String - id: ID! - organization: Organization - permissions: AgentTokenPermissions! - """ - Whether agents registered with this token will be visible to everyone, including people outside this organization - """ - public: Boolean! - """ - The time this agent token was revoked - """ - revokedAt: DateTime - """ - The user that revoked this agent token - """ - revokedBy: User - """ - The reason as defined by the user why this token was revoked - """ - revokedReason: String - """ - The token value used to register a new agent - """ - token: String! - """ - The public UUID for the agent - """ - uuid: ID! -} - -type AgentTokenConnection implements Connection { - count: Int! - edges: [AgentTokenEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of AgentTokenCreate -""" + agent: Agent! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String +} + +"""A token used to connect an agent to Buildkite""" +type AgentToken implements Node{ +"""The time this agent token was created""" + createdAt: DateTime +"""The user that created this agent token""" + createdBy: User +"""A description about what this agent token is used for""" + description: String + id: ID! + organization: Organization + permissions: AgentTokenPermissions! +"""Whether agents registered with this token will be visible to everyone, including people outside this organization""" + public: Boolean! +"""The time this agent token was revoked""" + revokedAt: DateTime +"""The user that revoked this agent token""" + revokedBy: User +"""The reason as defined by the user why this token was revoked""" + revokedReason: String +"""The token value used to register a new agent""" + token: String! +"""The public UUID for the agent""" + uuid: ID! +} + +type AgentTokenConnection implements Connection{ + count: Int! + edges: [AgentTokenEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of AgentTokenCreate""" input AgentTokenCreateInput { - """ - Autogenerated input type of AgentTokenCreate - """ - clientMutationId: String - """ - Autogenerated input type of AgentTokenCreate - """ - organizationID: ID! - """ - Autogenerated input type of AgentTokenCreate - """ - description: String - """ - Autogenerated input type of AgentTokenCreate - """ - public: Boolean +"""Autogenerated input type of AgentTokenCreate""" + clientMutationId: String +"""Autogenerated input type of AgentTokenCreate""" + organizationID: ID! +"""Autogenerated input type of AgentTokenCreate""" + description: String +"""Autogenerated input type of AgentTokenCreate""" + public: Boolean } -""" -Autogenerated return type of AgentTokenCreate. -""" +"""Autogenerated return type of AgentTokenCreate.""" type AgentTokenCreatePayload { - agentTokenEdge: AgentTokenEdge! - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - organization: Organization! - """ - The token value used to register a new agent. Please ensure to securely copy this value immediately upon generation as it will not be displayed again. - """ - tokenValue: String! + agentTokenEdge: AgentTokenEdge! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + organization: Organization! +"""The token value used to register a new agent. Please ensure to securely copy this value immediately upon generation as it will not be displayed again.""" + tokenValue: String! } type AgentTokenEdge { - cursor: String! - node: AgentToken + cursor: String! + node: AgentToken } -""" -Permissions information about what actions the current user can do against the agent token -""" +"""Permissions information about what actions the current user can do against the agent token""" type AgentTokenPermissions { - """ - Whether the user can revoke this agent token - """ - agentTokenRevoke: Permission +"""Whether the user can revoke this agent token""" + agentTokenRevoke: Permission } -""" -Autogenerated input type of AgentTokenRevoke -""" +"""Autogenerated input type of AgentTokenRevoke""" input AgentTokenRevokeInput { - """ - Autogenerated input type of AgentTokenRevoke - """ - clientMutationId: String - """ - Autogenerated input type of AgentTokenRevoke - """ - id: ID! - """ - Autogenerated input type of AgentTokenRevoke - """ - reason: String! +"""Autogenerated input type of AgentTokenRevoke""" + clientMutationId: String +"""Autogenerated input type of AgentTokenRevoke""" + id: ID! +"""Autogenerated input type of AgentTokenRevoke""" + reason: String! } -""" -Autogenerated return type of AgentTokenRevoke. -""" +"""Autogenerated return type of AgentTokenRevoke.""" type AgentTokenRevokePayload { - agentToken: AgentToken! - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String -} - -""" -An annotation allows you to add arbitrary content to the top of a build page in the Buildkite UI -""" -type Annotation implements Node { - """ - The body of the annotation - """ - body: AnnotationBody - """ - The context of the annotation that helps you differentiate this one from others - """ - context: String! - """ - The date the annotation was created - """ - createdAt: DateTime! - id: ID! - """ - The visual style of the annotation - """ - style: AnnotationStyle - """ - The last time the annotation was changed - """ - updatedAt: DateTime - """ - The public UUID for this annotation - """ - uuid: ID! -} - -""" -A body of an annotation -""" + agentToken: AgentToken! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String +} + +"""An annotation allows you to add arbitrary content to the top of a build page in the Buildkite UI""" +type Annotation implements Node{ +"""The body of the annotation""" + body: AnnotationBody +"""The context of the annotation that helps you differentiate this one from others""" + context: String! +"""The date the annotation was created""" + createdAt: DateTime! + id: ID! +"""The visual style of the annotation""" + style: AnnotationStyle +"""The last time the annotation was changed""" + updatedAt: DateTime +"""The public UUID for this annotation""" + uuid: ID! +} + +"""A body of an annotation""" type AnnotationBody { - """ - The body of the annotation rendered as HTML. The renderer result could be an empty string if the textual version has unsupported HTML tags - """ - html: String - """ - The body of the annotation as text - """ - text: String! +"""The body of the annotation rendered as HTML. The renderer result could be an empty string if the textual version has unsupported HTML tags""" + html: String +"""The body of the annotation as text""" + text: String! } -type AnnotationConnection implements Connection { - count: Int! - edges: [AnnotationEdge] - pageInfo: PageInfo +type AnnotationConnection implements Connection{ + count: Int! + edges: [AnnotationEdge] + pageInfo: PageInfo } type AnnotationEdge { - cursor: String! - node: Annotation + cursor: String! + node: Annotation } -""" -The visual style of the annotation -""" +"""The visual style of the annotation""" enum AnnotationStyle { - """ - The default styling of an annotation - """ - DEFAULT - """ - The annotation has a green border with a tick next to it - """ - SUCCESS - """ - The annotation has a blue border with an information icon next to it - """ - INFO - """ - The annotation has an orange border with a warning icon next to it - """ - WARNING - """ - The annotation has a red border with a cross next to it - """ - ERROR -} - -""" -A file uploaded from the agent whilst running a job -""" -type Artifact implements Node { - """ - The download URL for the artifact. Unless you've used your own artifact storage, the URL will be valid for only 10 minutes. - """ - downloadURL: String! - """ - The time when the artifact will, or did, expire - """ - expiresAt: DateTime - id: ID! - """ - The job that uploaded this artifact - """ - job: JobTypeCommand - """ - The mime type of the file provided by the agent - """ - mimeType: String! - """ - The path of the uploaded artifact - """ - path: String! - """ - A SHA1SUM of the file - """ - sha1sum: String! - """ - The size of the file in bytes that was uploaded - """ - size: Int! - """ - The upload state of the artifact - """ - state: String! - """ - The public UUID for this artifact - """ - uuid: ID! -} - -type ArtifactConnection implements Connection { - count: Int! - edges: [ArtifactEdge] - pageInfo: PageInfo +"""The default styling of an annotation""" + DEFAULT +"""The annotation has a green border with a tick next to it""" + SUCCESS +"""The annotation has a blue border with an information icon next to it""" + INFO +"""The annotation has an orange border with a warning icon next to it""" + WARNING +""" The annotation has a red border with a cross next to it""" + ERROR +} + +"""A file uploaded from the agent whilst running a job""" +type Artifact implements Node{ +"""The download URL for the artifact. Unless you've used your own artifact storage, the URL will be valid for only 10 minutes.""" + downloadURL: String! +"""The time when the artifact will, or did, expire""" + expiresAt: DateTime + id: ID! +"""The job that uploaded this artifact""" + job: JobTypeCommand +"""The mime type of the file provided by the agent""" + mimeType: String! +"""The path of the uploaded artifact""" + path: String! +"""A SHA1SUM of the file""" + sha1sum: String! +"""The size of the file in bytes that was uploaded""" + size: Int! +"""The upload state of the artifact""" + state: String! +"""The public UUID for this artifact""" + uuid: ID! +} + +type ArtifactConnection implements Connection{ + count: Int! + edges: [ArtifactEdge] + pageInfo: PageInfo } type ArtifactEdge { - cursor: String! - node: Artifact + cursor: String! + node: Artifact } -""" -Context for an audit event created during an REST/GraphQL API request -""" +"""Context for an audit event created during an REST/GraphQL API request""" type AuditAPIContext { - """ - The remote IP which made the request - """ - requestIpAddress: String - """ - The client supplied user agent which made the request - """ - requestUserAgent: String +"""The remote IP which made the request""" + requestIpAddress: String +"""The client supplied user agent which made the request""" + requestUserAgent: String } -""" -The actor who caused an AuditEvent -""" +"""The actor who caused an AuditEvent""" type AuditActor { - """ - The GraphQL ID for this actor - """ - id: ID! - """ - The name or short description of this actor - """ - name: String - """ - The node corresponding to this actor, if available - """ - node: AuditActorNode - """ - The type of this actor - """ - type: AuditActorType - """ - The public UUID of this actor - """ - uuid: ID! -} - -""" -Kinds of actors which can perform audit events -""" -union AuditActorNode = User - -""" -All the possible types of actors in an Audit Event -""" +"""The GraphQL ID for this actor""" + id: ID! +"""The name or short description of this actor""" + name: String +"""The node corresponding to this actor, if available""" + node: AuditActorNode +"""The type of this actor""" + type: AuditActorType +"""The public UUID of this actor""" + uuid: ID! +} + +"""Kinds of actors which can perform audit events""" +union AuditActorNode =User + +"""All the possible types of actors in an Audit Event""" enum AuditActorType { - USER -} - -""" -Kinds of contexts in which an audit event can be performed -""" -union AuditContext = AuditAPIContext | AuditWebContext - -""" -Audit record of an event which occurred in the system -""" -type AuditEvent implements Node { - """ - The actor who caused this event - """ - actor: AuditActor - """ - The context in which this event occurred - """ - context: AuditContext - """ - The changed data in the event - """ - data: JSON - id: ID! - """ - The time at which this event occurred - """ - occurredAt: DateTime! - """ - The subject of this event - """ - subject: AuditSubject - """ - The type of event - """ - type: AuditEventType! - """ - The public UUID for the event - """ - uuid: ID! -} - -""" -All the possible types of an Audit Event -""" + USER +} + +"""Kinds of contexts in which an audit event can be performed""" +union AuditContext =AuditAPIContext | AuditWebContext + +"""Audit record of an event which occurred in the system""" +type AuditEvent implements Node{ +"""The actor who caused this event""" + actor: AuditActor +"""The context in which this event occurred""" + context: AuditContext +"""The changed data in the event""" + data: JSON + id: ID! +"""The time at which this event occurred""" + occurredAt: DateTime! +"""The subject of this event""" + subject: AuditSubject +"""The type of event""" + type: AuditEventType! +"""The public UUID for the event""" + uuid: ID! +} + +"""All the possible types of an Audit Event""" enum AuditEventType { - API_ACCESS_TOKEN_CREATED - API_ACCESS_TOKEN_DELETED - API_ACCESS_TOKEN_ORGANIZATION_ACCESS_REVOKED - API_ACCESS_TOKEN_UPDATED - AGENT_TOKEN_CREATED - AGENT_TOKEN_REVOKED - AGENT_TOKEN_UPDATED - AUTHORIZATION_CREATED - AUTHORIZATION_DELETED - CLUSTER_CREATED - CLUSTER_DELETED - CLUSTER_PERMISSION_CREATED - CLUSTER_PERMISSION_DELETED - CLUSTER_QUEUE_CREATED - CLUSTER_QUEUE_DELETED - CLUSTER_QUEUE_UPDATED - CLUSTER_TOKEN_CREATED - CLUSTER_TOKEN_DELETED - CLUSTER_TOKEN_UPDATED - CLUSTER_UPDATED - NOTIFICATION_SERVICE_BROKEN - NOTIFICATION_SERVICE_CREATED - NOTIFICATION_SERVICE_DELETED - NOTIFICATION_SERVICE_DISABLED - NOTIFICATION_SERVICE_ENABLED - NOTIFICATION_SERVICE_UPDATED - ORGANIZATION_BUILD_EXPORT_UPDATED - ORGANIZATION_CREATED - ORGANIZATION_DELETED - ORGANIZATION_INVITATION_ACCEPTED - ORGANIZATION_INVITATION_CREATED - ORGANIZATION_INVITATION_RESENT - ORGANIZATION_INVITATION_REVOKED - ORGANIZATION_MEMBER_CREATED - ORGANIZATION_MEMBER_DELETED - ORGANIZATION_MEMBER_UPDATED - ORGANIZATION_TEAMS_DISABLED - ORGANIZATION_TEAMS_ENABLED - ORGANIZATION_UPDATED - PIPELINE_CREATED - PIPELINE_DELETED - PIPELINE_SCHEDULE_CREATED - PIPELINE_SCHEDULE_DELETED - PIPELINE_SCHEDULE_UPDATED - PIPELINE_UPDATED - PIPELINE_VISIBILITY_CHANGED - PIPELINE_WEBHOOK_URL_ROTATED - SCM_PIPELINE_SETTINGS_CREATED - SCM_PIPELINE_SETTINGS_DELETED - SCM_PIPELINE_SETTINGS_UPDATED - SCM_REPOSITORY_HOST_CREATED - SCM_REPOSITORY_HOST_DESTROYED - SCM_REPOSITORY_HOST_UPDATED - SCM_SERVICE_CREATED - SCM_SERVICE_DELETED - SCM_SERVICE_UPDATED - SSO_PROVIDER_CREATED - SSO_PROVIDER_DELETED - SSO_PROVIDER_DISABLED - SSO_PROVIDER_ENABLED - SSO_PROVIDER_UPDATED - SUBSCRIPTION_PLAN_CHANGE_SCHEDULED - SUBSCRIPTION_PLAN_CHANGED - SUITE_API_TOKEN_REGENERATED - SUITE_CREATED - SUITE_DELETED - SUITE_MONITOR_CREATED - SUITE_MONITOR_DELETED - SUITE_MONITOR_UPDATED - SUITE_UPDATED - SUITE_VISIBILITY_CHANGED - TEAM_CREATED - TEAM_DELETED - TEAM_MEMBER_CREATED - TEAM_MEMBER_DELETED - TEAM_MEMBER_UPDATED - TEAM_PIPELINE_CREATED - TEAM_PIPELINE_DELETED - TEAM_PIPELINE_UPDATED - TEAM_SUITE_CREATED - TEAM_SUITE_DELETED - TEAM_SUITE_UPDATED - TEAM_UPDATED - USER_API_ACCESS_TOKEN_ORGANIZATION_ACCESS_ADDED - USER_API_ACCESS_TOKEN_ORGANIZATION_ACCESS_REMOVED - USER_EMAIL_CREATED - USER_EMAIL_DELETED - USER_EMAIL_MARKED_PRIMARY - USER_EMAIL_VERIFIED - USER_PASSWORD_RESET - USER_PASSWORD_RESET_REQUESTED - USER_TOTP_ACTIVATED - USER_TOTP_CREATED - USER_TOTP_DELETED - USER_UPDATED -} - -""" -The subject of an AuditEvent -""" + API_ACCESS_TOKEN_CREATED + API_ACCESS_TOKEN_DELETED + API_ACCESS_TOKEN_ORGANIZATION_ACCESS_REVOKED + API_ACCESS_TOKEN_UPDATED + AGENT_TOKEN_CREATED + AGENT_TOKEN_REVOKED + AGENT_TOKEN_UPDATED + AUTHORIZATION_CREATED + AUTHORIZATION_DELETED + CLUSTER_CREATED + CLUSTER_DELETED + CLUSTER_PERMISSION_CREATED + CLUSTER_PERMISSION_DELETED + CLUSTER_QUEUE_CREATED + CLUSTER_QUEUE_DELETED + CLUSTER_QUEUE_UPDATED + CLUSTER_TOKEN_CREATED + CLUSTER_TOKEN_DELETED + CLUSTER_TOKEN_UPDATED + CLUSTER_UPDATED + NOTIFICATION_SERVICE_BROKEN + NOTIFICATION_SERVICE_CREATED + NOTIFICATION_SERVICE_DELETED + NOTIFICATION_SERVICE_DISABLED + NOTIFICATION_SERVICE_ENABLED + NOTIFICATION_SERVICE_UPDATED + ORGANIZATION_BUILD_EXPORT_UPDATED + ORGANIZATION_CREATED + ORGANIZATION_DELETED + ORGANIZATION_INVITATION_ACCEPTED + ORGANIZATION_INVITATION_CREATED + ORGANIZATION_INVITATION_RESENT + ORGANIZATION_INVITATION_REVOKED + ORGANIZATION_MEMBER_CREATED + ORGANIZATION_MEMBER_DELETED + ORGANIZATION_MEMBER_UPDATED + ORGANIZATION_TEAMS_DISABLED + ORGANIZATION_TEAMS_ENABLED + ORGANIZATION_UPDATED + PIPELINE_CREATED + PIPELINE_DELETED + PIPELINE_SCHEDULE_CREATED + PIPELINE_SCHEDULE_DELETED + PIPELINE_SCHEDULE_UPDATED + PIPELINE_UPDATED + PIPELINE_VISIBILITY_CHANGED + PIPELINE_WEBHOOK_URL_ROTATED + SCM_PIPELINE_SETTINGS_CREATED + SCM_PIPELINE_SETTINGS_DELETED + SCM_PIPELINE_SETTINGS_UPDATED + SCM_REPOSITORY_HOST_CREATED + SCM_REPOSITORY_HOST_DESTROYED + SCM_REPOSITORY_HOST_UPDATED + SCM_SERVICE_CREATED + SCM_SERVICE_DELETED + SCM_SERVICE_UPDATED + SSO_PROVIDER_CREATED + SSO_PROVIDER_DELETED + SSO_PROVIDER_DISABLED + SSO_PROVIDER_ENABLED + SSO_PROVIDER_UPDATED + SUBSCRIPTION_PLAN_CHANGE_SCHEDULED + SUBSCRIPTION_PLAN_CHANGED + SUITE_API_TOKEN_REGENERATED + SUITE_CREATED + SUITE_DELETED + SUITE_MONITOR_CREATED + SUITE_MONITOR_DELETED + SUITE_MONITOR_UPDATED + SUITE_UPDATED + SUITE_VISIBILITY_CHANGED + TEAM_CREATED + TEAM_DELETED + TEAM_MEMBER_CREATED + TEAM_MEMBER_DELETED + TEAM_MEMBER_UPDATED + TEAM_PIPELINE_CREATED + TEAM_PIPELINE_DELETED + TEAM_PIPELINE_UPDATED + TEAM_SUITE_CREATED + TEAM_SUITE_DELETED + TEAM_SUITE_UPDATED + TEAM_UPDATED + USER_API_ACCESS_TOKEN_ORGANIZATION_ACCESS_ADDED + USER_API_ACCESS_TOKEN_ORGANIZATION_ACCESS_REMOVED + USER_EMAIL_CREATED + USER_EMAIL_DELETED + USER_EMAIL_MARKED_PRIMARY + USER_EMAIL_VERIFIED + USER_PASSWORD_RESET + USER_PASSWORD_RESET_REQUESTED + USER_TOTP_ACTIVATED + USER_TOTP_CREATED + USER_TOTP_DELETED + USER_UPDATED +} + +"""The subject of an AuditEvent""" type AuditSubject { - """ - The GraphQL ID for the subject - """ - id: ID! - """ - The name or short description of this subject - """ - name: String - """ - The node corresponding to the subject, if available - """ - node: AuditSubjectNode - """ - The type of this subject - """ - type: AuditSubjectType - """ - The public UUID of this subject - """ - uuid: ID! -} - -""" -Kinds of subjects which can have audit events performed on them -""" -union AuditSubjectNode = - APIAccessToken - | AgentToken - | AuthorizationBitbucket - | AuthorizationGitHub - | AuthorizationGitHubEnterprise - | Cluster - | ClusterPermission - | ClusterQueue - | ClusterToken - | Email - | NotificationServiceSlack - | NotificationServiceWebhook - | Organization - | OrganizationInvitation - | OrganizationMember - | Pipeline - | PipelineSchedule - | SCMPipelineSettings - | SCMRepositoryHost - | SCMService - | SSOProviderGitHubApp - | SSOProviderGoogleGSuite - | SSOProviderSAML - | Subscription - | Suite - | TOTP - | Team - | TeamMember - | TeamPipeline - | TeamSuite - | User - -""" -All the possible types of subjects in an Audit Event -""" +"""The GraphQL ID for the subject""" + id: ID! +"""The name or short description of this subject""" + name: String +"""The node corresponding to the subject, if available""" + node: AuditSubjectNode +"""The type of this subject""" + type: AuditSubjectType +"""The public UUID of this subject""" + uuid: ID! +} + +"""Kinds of subjects which can have audit events performed on them""" +union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | AuthorizationGitHub | AuthorizationGitHubEnterprise | Cluster | ClusterPermission | ClusterQueue | ClusterToken | Email | NotificationServiceSlack | NotificationServiceWebhook | Organization | OrganizationInvitation | OrganizationMember | Pipeline | PipelineSchedule | SCMPipelineSettings | SCMRepositoryHost | SCMService | SSOProviderGitHubApp | SSOProviderGoogleGSuite | SSOProviderSAML | Subscription | Suite | TOTP | Team | TeamMember | TeamPipeline | TeamSuite | User + +"""All the possible types of subjects in an Audit Event""" enum AuditSubjectType { - USER_EMAIL - USER - CLUSTER - AGENT_TOKEN - API_ACCESS_TOKEN - CLUSTER_QUEUE - AUTHORIZATION - CLUSTER_TOKEN - ORGANIZATION - CLUSTER_PERMISSION - NOTIFICATION_SERVICE - PIPELINE_SCHEDULE - ORGANIZATION_INVITATION - TEAM_MEMBER - TEAM - TEAM_SUITE - TEAM_PIPELINE - SCM_PIPELINE_SETTINGS - SCM_SERVICE - SUITE_MONITOR - SCM_REPOSITORY_HOST - PIPELINE - SUITE - SUBSCRIPTION - USER_TOTP - SSO_PROVIDER - ORGANIZATION_MEMBER -} - -""" -Context for an audit event created during a web request -""" + SUITE + USER_EMAIL + USER_TOTP + SSO_PROVIDER + ORGANIZATION_MEMBER + USER + CLUSTER + AUTHORIZATION + SUBSCRIPTION + CLUSTER_PERMISSION + AGENT_TOKEN + API_ACCESS_TOKEN + CLUSTER_QUEUE + CLUSTER_TOKEN + NOTIFICATION_SERVICE + ORGANIZATION + ORGANIZATION_INVITATION + PIPELINE_SCHEDULE + TEAM + TEAM_MEMBER + TEAM_PIPELINE + PIPELINE + TEAM_SUITE + SCM_SERVICE + SCM_PIPELINE_SETTINGS + SCM_REPOSITORY_HOST + SUITE_MONITOR +} + +"""Context for an audit event created during a web request""" type AuditWebContext { - """ - The remote IP which made the request - """ - requestIpAddress: String - """ - The client supplied user agent which made the request - """ - requestUserAgent: String - """ - When the session started, if available - """ - sessionCreatedAt: DateTime - """ - When the session was escalated, if available and escalated - """ - sessionEscalatedAt: DateTime - """ - The session's authenticated user, if available - """ - sessionUser: User - """ - The session's authenticated user's uuid - """ - sessionUserUuid: ID +"""The remote IP which made the request""" + requestIpAddress: String +"""The client supplied user agent which made the request""" + requestUserAgent: String +"""When the session started, if available""" + sessionCreatedAt: DateTime +"""When the session was escalated, if available and escalated""" + sessionEscalatedAt: DateTime +"""The session's authenticated user, if available""" + sessionUser: User +"""The session's authenticated user's uuid""" + sessionUserUuid: ID } interface Authorization { - id: ID! + id: ID! } -""" -A Bitbucket account authorized with a Buildkite account -""" -type AuthorizationBitbucket implements Authorization & Node { - """ - ID of the object. - """ - id: ID! +"""A Bitbucket account authorized with a Buildkite account""" +type AuthorizationBitbucket implements Authorization & Node{ +"""ID of the object.""" + id: ID! } -type AuthorizationConnection implements Connection { - count: Int! - edges: [AuthorizationEdge] - pageInfo: PageInfo +type AuthorizationConnection implements Connection{ + count: Int! + edges: [AuthorizationEdge] + pageInfo: PageInfo } type AuthorizationEdge { - cursor: String! - node: Authorization + cursor: String! + node: Authorization } -""" -A GitHub account authorized with a Buildkite account -""" -type AuthorizationGitHub implements Authorization & Node { - """ - ID of the object. - """ - id: ID! +"""A GitHub account authorized with a Buildkite account""" +type AuthorizationGitHub implements Authorization & Node{ +"""ID of the object.""" + id: ID! } -""" -A GitHub app authorized with a Buildkite account -""" -type AuthorizationGitHubApp implements Authorization & Node { - """ - ID of the object. - """ - id: ID! +"""A GitHub app authorized with a Buildkite account""" +type AuthorizationGitHubApp implements Authorization & Node{ +"""ID of the object.""" + id: ID! } -""" -A GitHub Enterprise account authorized with a Buildkite account -""" -type AuthorizationGitHubEnterprise implements Authorization & Node { - """ - ID of the object. - """ - id: ID! +"""A GitHub Enterprise account authorized with a Buildkite account""" +type AuthorizationGitHubEnterprise implements Authorization & Node{ +"""ID of the object.""" + id: ID! } -""" -A Google account authorized with a Buildkite account -""" -type AuthorizationGoogle implements Authorization & Node { - """ - ID of the object. - """ - id: ID! +"""A Google account authorized with a Buildkite account""" +type AuthorizationGoogle implements Authorization & Node{ +"""ID of the object.""" + id: ID! } -""" -A SAML account authorized with a Buildkite account -""" -type AuthorizationSAML implements Authorization & Node { - """ - ID of the object. - """ - id: ID! +"""A SAML account authorized with a Buildkite account""" +type AuthorizationSAML implements Authorization & Node{ +"""ID of the object.""" + id: ID! } -""" -The type of the authorization -""" +"""The type of the authorization""" enum AuthorizationType { - """ - GitHub Authorization - """ - GITHUB - """ - GitHub Enterprise Authorization - """ - GITHUB_ENTERPRISE - """ - Bitbucket Authorization - """ - BITBUCKET +"""GitHub Authorization""" + GITHUB +"""GitHub Enterprise Authorization""" + GITHUB_ENTERPRISE +"""Bitbucket Authorization""" + BITBUCKET } -""" -An avatar belonging to a user -""" +"""An avatar belonging to a user""" type Avatar { - """ - The URL of the avatar - """ - url: String! +"""The URL of the avatar""" + url: String! } -""" -Represents `true` or `false` values. -""" +"""Represents `true` or `false` values.""" scalar Boolean -""" -A build from a pipeline -""" -type Build implements Node { - annotations( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - style: [AnnotationStyle!] - ): AnnotationConnection - """ - The current blocked state of the build - """ - blockedState: BuildBlockedStates - """ - The branch for the build - """ - branch: String! - """ - The time when the build was cancelled - """ - canceledAt: DateTime - """ - The user who canceled this build. If the build was canceled, and this value is null, then it was canceled automatically by Buildkite - """ - canceledBy: User - """ - The fully-qualified commit for the build - """ - commit: String! - """ - The time when the build was created - """ - createdAt: DateTime - createdBy: BuildCreator - """ - Custom environment variables passed to this build - """ - env: [String!] - """ - The time when the build finished - """ - finishedAt: DateTime - id: ID! - jobs( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - type: [JobTypes!] - state: [JobStates!] - priority: JobPrioritySearch - agentQueryRules: [String!] - concurrency: JobConcurrencySearch - """ - Whether or not the command job passed. Passing `false` will return all failed jobs (including "soft failed" jobs) - """ - passed: Boolean - """ - Filtering jobs based on related step information - """ - step: JobStepSearch - """ - Order the jobs - """ - order: JobOrder - ): JobConnection - """ - The message for the build - """ - message: String - metaData(first: Int, last: Int): BuildMetaDataConnection - """ - The number of the build - """ - number: Int! - organization: Organization! - pipeline: Pipeline! - pullRequest: PullRequest - """ - The build that this build was rebuilt from - """ - rebuiltFrom: Build - """ - The time when the build became scheduled for running - """ - scheduledAt: DateTime - """ - Where the build was created - """ - source: BuildSource! - """ - The time when the build started running - """ - startedAt: DateTime - """ - The current state of the build - """ - state: BuildStates! - """ - The job that this build was triggered from - """ - triggeredFrom: JobTypeTrigger - """ - The URL for the build - """ - url: String! - """ - The UUID for the build - """ - uuid: String! -} - -""" -Autogenerated input type of BuildAnnotate -""" +"""A build from a pipeline""" +type Build implements Node{ + annotations( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + style: [AnnotationStyle!] + ): AnnotationConnection +"""The current blocked state of the build""" + blockedState: BuildBlockedStates +"""The branch for the build""" + branch: String! +"""The time when the build was cancelled""" + canceledAt: DateTime +"""The user who canceled this build. If the build was canceled, and this value is null, then it was canceled automatically by Buildkite""" + canceledBy: User +"""The fully-qualified commit for the build""" + commit: String! +"""The time when the build was created""" + createdAt: DateTime + createdBy: BuildCreator +"""Custom environment variables passed to this build""" + env: [String!] +"""The time when the build finished""" + finishedAt: DateTime + id: ID! + jobs( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + type: [JobTypes!] + state: [JobStates!] + priority: JobPrioritySearch + agentQueryRules: [String!] + concurrency: JobConcurrencySearch +"""Whether or not the command job passed. Passing `false` will return all failed jobs (including "soft failed" jobs)""" + passed: Boolean +"""Filtering jobs based on related step information""" + step: JobStepSearch +"""Order the jobs""" + order: JobOrder + ): JobConnection +"""The message for the build""" + message: String + metaData( + first: Int + last: Int + ): BuildMetaDataConnection +"""The number of the build""" + number: Int! + organization: Organization! + pipeline: Pipeline! + pullRequest: PullRequest +"""The build that this build was rebuilt from""" + rebuiltFrom: Build +"""The time when the build became scheduled for running""" + scheduledAt: DateTime +"""Where the build was created""" + source: BuildSource! +"""The time when the build started running""" + startedAt: DateTime +"""The current state of the build""" + state: BuildStates! +"""The job that this build was triggered from""" + triggeredFrom: JobTypeTrigger +"""The URL for the build""" + url: String! +"""The UUID for the build""" + uuid: String! +} + +"""Autogenerated input type of BuildAnnotate""" input BuildAnnotateInput { - """ - Autogenerated input type of BuildAnnotate - """ - clientMutationId: String - """ - Autogenerated input type of BuildAnnotate - """ - buildID: ID! - """ - Autogenerated input type of BuildAnnotate - """ - body: String - """ - Autogenerated input type of BuildAnnotate - """ - style: AnnotationStyle - """ - Autogenerated input type of BuildAnnotate - """ - context: String - """ - Autogenerated input type of BuildAnnotate - """ - append: Boolean -} - -""" -Autogenerated return type of BuildAnnotate. -""" +"""Autogenerated input type of BuildAnnotate""" + clientMutationId: String +"""Autogenerated input type of BuildAnnotate""" + buildID: ID! +"""Autogenerated input type of BuildAnnotate""" + body: String +"""Autogenerated input type of BuildAnnotate""" + style: AnnotationStyle +"""Autogenerated input type of BuildAnnotate""" + context: String +"""Autogenerated input type of BuildAnnotate""" + append: Boolean +} + +"""Autogenerated return type of BuildAnnotate.""" type BuildAnnotatePayload { - annotation: Annotation - annotationEdge: AnnotationEdge - build: Build - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String + annotation: Annotation + annotationEdge: AnnotationEdge + build: Build +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String } -""" -Author for a build -""" +"""Author for a build""" input BuildAuthorInput { - """ - Author for a build - """ - name: String! - """ - Author for a build - """ - email: String! +"""Author for a build""" + name: String! +"""Author for a build""" + email: String! } -""" -All the possible blocked states a build can be in -""" +"""All the possible blocked states a build can be in""" enum BuildBlockedStates { - """ - The blocked build is running - """ - RUNNING - """ - The blocked build is passed - """ - PASSED - """ - The blocked build is failed - """ - FAILED +"""The blocked build is running""" + RUNNING +"""The blocked build is passed""" + PASSED +"""The blocked build is failed""" + FAILED } -""" -Autogenerated input type of BuildCancel -""" +"""Autogenerated input type of BuildCancel""" input BuildCancelInput { - """ - Autogenerated input type of BuildCancel - """ - clientMutationId: String - """ - Autogenerated input type of BuildCancel - """ - id: ID! +"""Autogenerated input type of BuildCancel""" + clientMutationId: String +"""Autogenerated input type of BuildCancel""" + id: ID! } -""" -Autogenerated return type of BuildCancel. -""" +"""Autogenerated return type of BuildCancel.""" type BuildCancelPayload { - build: Build! - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String + build: Build! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String } -type BuildConnection implements Connection { - count: Int! - edges: [BuildEdge] - pageInfo: PageInfo +type BuildConnection implements Connection{ + count: Int! + edges: [BuildEdge] + pageInfo: PageInfo } -""" -Autogenerated input type of BuildCreate -""" +"""Autogenerated input type of BuildCreate""" input BuildCreateInput { - """ - Autogenerated input type of BuildCreate - """ - clientMutationId: String - """ - Autogenerated input type of BuildCreate - """ - pipelineID: ID! - """ - Autogenerated input type of BuildCreate - """ - message: String - """ - Autogenerated input type of BuildCreate - """ - commit: String - """ - Autogenerated input type of BuildCreate - """ - branch: String - """ - Autogenerated input type of BuildCreate - """ - env: [String!] - """ - Autogenerated input type of BuildCreate - """ - metaData: [BuildMetaDataInput!] - """ - Autogenerated input type of BuildCreate - """ - author: BuildAuthorInput -} - -""" -Autogenerated return type of BuildCreate. -""" +"""Autogenerated input type of BuildCreate""" + clientMutationId: String +"""Autogenerated input type of BuildCreate""" + pipelineID: ID! +"""Autogenerated input type of BuildCreate""" + message: String +"""Autogenerated input type of BuildCreate""" + commit: String +"""Autogenerated input type of BuildCreate""" + branch: String +"""Autogenerated input type of BuildCreate""" + env: [String!] +"""Autogenerated input type of BuildCreate""" + metaData: [BuildMetaDataInput!] +"""Autogenerated input type of BuildCreate""" + author: BuildAuthorInput +} + +"""Autogenerated return type of BuildCreate.""" type BuildCreatePayload { - build: Build - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String + build: Build +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String } -""" -Either a `User` or an `UnregisteredUser` type -""" -union BuildCreator = UnregisteredUser | User +"""Either a `User` or an `UnregisteredUser` type""" +union BuildCreator =UnregisteredUser | User type BuildEdge { - cursor: String! - node: Build + cursor: String! + node: Build } -""" -A comment on a build -""" +"""A comment on a build""" type BuildMetaData { - """ - The key used to set this meta data - """ - key: String! - """ - The value set to this meta data - """ - value: String! +"""The key used to set this meta data""" + key: String! +"""The value set to this meta data""" + value: String! } -type BuildMetaDataConnection implements Connection { - count: Int! - edges: [BuildMetaDataEdge] - pageInfo: PageInfo +type BuildMetaDataConnection implements Connection{ + count: Int! + edges: [BuildMetaDataEdge] + pageInfo: PageInfo } type BuildMetaDataEdge { - cursor: String! - node: BuildMetaData + cursor: String! + node: BuildMetaData } -""" -Meta-data key/value pairs for a build -""" +"""Meta-data key/value pairs for a build""" input BuildMetaDataInput { - """ - Meta-data key/value pairs for a build - """ - key: String! - """ - Meta-data key/value pairs for a build - """ - value: String! +"""Meta-data key/value pairs for a build""" + key: String! +"""Meta-data key/value pairs for a build""" + value: String! } -""" -Autogenerated input type of BuildRebuild -""" +"""Autogenerated input type of BuildRebuild""" input BuildRebuildInput { - """ - Autogenerated input type of BuildRebuild - """ - clientMutationId: String - """ - Autogenerated input type of BuildRebuild - """ - id: ID! +"""Autogenerated input type of BuildRebuild""" + clientMutationId: String +"""Autogenerated input type of BuildRebuild""" + id: ID! } -""" -Autogenerated return type of BuildRebuild. -""" +"""Autogenerated return type of BuildRebuild.""" type BuildRebuildPayload { - build: Build! - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - rebuild: Build! + build: Build! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + rebuild: Build! } -""" -All the possible build retention periods, depending on your billing plan -""" +"""All the possible build retention periods, depending on your billing plan""" enum BuildRetentionPeriods { - """ - 30 days - """ - DAYS_30 - """ - 60 days - """ - DAYS_60 - """ - 90 days - """ - DAYS_90 - """ - 6 months - """ - MONTHS_6 - """ - 12 months - """ - MONTHS_12 - """ - 18 months - """ - MONTHS_18 - """ - 2 years - """ - YEARS_2 +"""30 days""" + DAYS_30 +"""60 days""" + DAYS_60 +"""90 days""" + DAYS_90 +"""6 months""" + MONTHS_6 +"""12 months""" + MONTHS_12 +"""18 months""" + MONTHS_18 +"""2 years""" + YEARS_2 } interface BuildSource { - name: String! + name: String! } -""" -A build was triggered via an API -""" -type BuildSourceAPI implements BuildSource { - name: String! +"""A build was triggered via an API""" +type BuildSourceAPI implements BuildSource{ + name: String! } -""" -A build was triggered manually via the frontend -""" -type BuildSourceFrontend implements BuildSource { - name: String! +"""A build was triggered manually via the frontend""" +type BuildSourceFrontend implements BuildSource{ + name: String! } -""" -A build was triggered via a schedule -""" -type BuildSourceSchedule implements BuildSource { - name: String! - """ - The associated schedule that created this build. Will be `null` if the associated schedule has been deleted. - """ - pipelineSchedule: PipelineSchedule +"""A build was triggered via a schedule""" +type BuildSourceSchedule implements BuildSource{ + name: String! +"""The associated schedule that created this build. Will be `null` if the associated schedule has been deleted.""" + pipelineSchedule: PipelineSchedule } -""" -A build was triggered via a trigger job -""" -type BuildSourceTriggerJob implements BuildSource { - name: String! +"""A build was triggered via a trigger job""" +type BuildSourceTriggerJob implements BuildSource{ + name: String! } -""" -A build was triggered via a Webhook -""" -type BuildSourceWebhook implements BuildSource { - """ - Provider specific headers sent along with the webhook. This will return null if the webhook has been purged by Buildkite. - """ - headers: [String!] - name: String! - """ - The body of the webhook. Buildkite only stores webhook data for a short period of time, so if this returns null - then the webhook data has been purged by Buildkite - """ - payload: JSON - """ - The UUID for this webhook. This will return null if the webhook has been purged by Buildkite - """ - uuid: String +"""A build was triggered via a Webhook""" +type BuildSourceWebhook implements BuildSource{ +"""Provider specific headers sent along with the webhook. This will return null if the webhook has been purged by Buildkite.""" + headers: [String!] + name: String! +"""The body of the webhook. Buildkite only stores webhook data for a short period of time, so if this returns null - then the webhook data has been purged by Buildkite""" + payload: JSON +"""The UUID for this webhook. This will return null if the webhook has been purged by Buildkite""" + uuid: String } -""" -All the possible states a build can be in -""" +"""All the possible states a build can be in""" enum BuildStates { - """ - The build was skipped - """ - SKIPPED - """ - The build is currently being created - """ - CREATING - """ - The build has yet to start running jobs - """ - SCHEDULED - """ - The build is currently running jobs - """ - RUNNING - """ - The build passed - """ - PASSED - """ - The build failed - """ - FAILED - """ - The build is failing - """ - FAILING - """ - The build is currently being canceled - """ - CANCELING - """ - The build was canceled - """ - CANCELED - """ - The build is blocked - """ - BLOCKED - """ - The build wasn't run - """ - NOT_RUN -} - -""" -The results of a `buildkite-agent pipeline upload` -""" +"""The build was skipped""" + SKIPPED +"""The build is currently being created""" + CREATING +"""The build has yet to start running jobs""" + SCHEDULED +"""The build is currently running jobs""" + RUNNING +"""The build passed""" + PASSED +"""The build failed""" + FAILED +"""The build is failing""" + FAILING +"""The build is currently being canceled""" + CANCELING +"""The build was canceled""" + CANCELED +"""The build is blocked""" + BLOCKED +"""The build wasn't run""" + NOT_RUN +} + +"""The results of a `buildkite-agent pipeline upload`""" type BuildStepUpload { - """ - The uploaded step definition - """ - definition: BuildStepUploadDefinition! - id: ID! - """ - The UUID for this build step upload - """ - uuid: ID! +"""The uploaded step definition""" + definition: BuildStepUploadDefinition! + id: ID! +"""The UUID for this build step upload""" + uuid: ID! } -""" -The pipeline definition for a step upload -""" +"""The pipeline definition for a step upload""" type BuildStepUploadDefinition { - """ - The uploaded step definition rendered as JSON - """ - json: String! - """ - The uploaded step definition rendered as YAML - """ - yaml: String! -} - -""" -A changelog -""" -type Changelog implements Node { - author: ChangelogAuthor - """ - The body of this changelog - """ - body: String - id: ID! - """ - The date and time this changelog was published - """ - publishedAt: DateTime - """ - The tag for this changelog - """ - tag: String! - """ - The title for this changelog - """ - title: String! - """ - The public UUID for this changelog - """ - uuid: String! -} - -""" -The author of the changelog -""" +"""The uploaded step definition rendered as JSON""" + json: String! +"""The uploaded step definition rendered as YAML""" + yaml: String! +} + +"""A changelog""" +type Changelog implements Node{ + author: ChangelogAuthor +"""The body of this changelog""" + body: String + id: ID! +"""The date and time this changelog was published""" + publishedAt: DateTime +"""The tag for this changelog""" + tag: String! +"""The title for this changelog""" + title: String! +"""The public UUID for this changelog""" + uuid: String! +} + +"""The author of the changelog""" type ChangelogAuthor { - avatar: Avatar! - """ - The name of the author - """ - name: String! + avatar: Avatar! +"""The name of the author""" + name: String! } -type ChangelogConnection implements Connection { - count: Int! - edges: [ChangelogEdge] - pageInfo: PageInfo +type ChangelogConnection implements Connection{ + count: Int! + edges: [ChangelogEdge] + pageInfo: PageInfo } type ChangelogEdge { - cursor: String! - node: Changelog + cursor: String! + node: Changelog } type Cluster { - """ - Returns agent tokens for the Cluster - """ - agentTokens(first: Int, last: Int): ClusterAgentTokenConnection - """ - Color hex code for the cluster - """ - color: String - """ - User who created the cluster - """ - createdBy: User - """ - The default queue that agents connecting to the cluster without specifying a queue will accept jobs from - """ - defaultQueue: ClusterQueue - """ - Description of the cluster - """ - description: String - """ - Emoji for the cluster using Buildkite emoji syntax - """ - emoji: String - id: ID! - """ - Name of the cluster - """ - name: String! - organization: Organization - queues( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - """ - Order the cluster queues - """ - order: ClusterQueueOrder - ): ClusterQueueConnection - """ - The public UUID for this cluster - """ - uuid: ID! -} - -type ClusterAgentTokenConnection implements Connection { - count: Int! - edges: [ClusterAgentTokenEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of ClusterAgentTokenCreate -""" +"""Returns agent tokens for the Cluster""" + agentTokens( + first: Int + last: Int + ): ClusterAgentTokenConnection +"""Color hex code for the cluster""" + color: String +"""User who created the cluster""" + createdBy: User +"""The default queue that agents connecting to the cluster without specifying a queue will accept jobs from""" + defaultQueue: ClusterQueue +"""Description of the cluster""" + description: String +"""Emoji for the cluster using Buildkite emoji syntax""" + emoji: String + id: ID! +"""Name of the cluster""" + name: String! + organization: Organization + queues( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String +"""Order the cluster queues""" + order: ClusterQueueOrder + ): ClusterQueueConnection +"""The public UUID for this cluster""" + uuid: ID! +} + +type ClusterAgentTokenConnection implements Connection{ + count: Int! + edges: [ClusterAgentTokenEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of ClusterAgentTokenCreate""" input ClusterAgentTokenCreateInput { - """ - Autogenerated input type of ClusterAgentTokenCreate - """ - clientMutationId: String - """ - Autogenerated input type of ClusterAgentTokenCreate - """ - organizationId: ID! - """ - Autogenerated input type of ClusterAgentTokenCreate - """ - description: String! - """ - Autogenerated input type of ClusterAgentTokenCreate - """ - clusterId: ID! - """ - Autogenerated input type of ClusterAgentTokenCreate - """ - jobTokensEnabled: Boolean - """ - Autogenerated input type of ClusterAgentTokenCreate - """ - allowedIpAddresses: String -} - -""" -Autogenerated return type of ClusterAgentTokenCreate. -""" +"""Autogenerated input type of ClusterAgentTokenCreate""" + clientMutationId: String +"""Autogenerated input type of ClusterAgentTokenCreate""" + organizationId: ID! +"""Autogenerated input type of ClusterAgentTokenCreate""" + description: String! +"""Autogenerated input type of ClusterAgentTokenCreate""" + clusterId: ID! +"""Autogenerated input type of ClusterAgentTokenCreate""" + jobTokensEnabled: Boolean +"""Autogenerated input type of ClusterAgentTokenCreate""" + allowedIpAddresses: String +} + +"""Autogenerated return type of ClusterAgentTokenCreate.""" type ClusterAgentTokenCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - clusterAgentToken: ClusterToken! - """ - The token value used to register a new agent to this tokens cluster. Please ensure to securely copy this value immediately upon generation as it will not be displayed again. - """ - tokenValue: String! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + clusterAgentToken: ClusterToken! +"""The token value used to register a new agent to this tokens cluster. Please ensure to securely copy this value immediately upon generation as it will not be displayed again.""" + tokenValue: String! } type ClusterAgentTokenEdge { - cursor: String! - node: ClusterToken + cursor: String! + node: ClusterToken } -""" -Autogenerated input type of ClusterAgentTokenRevoke -""" +"""Autogenerated input type of ClusterAgentTokenRevoke""" input ClusterAgentTokenRevokeInput { - """ - Autogenerated input type of ClusterAgentTokenRevoke - """ - clientMutationId: String - """ - Autogenerated input type of ClusterAgentTokenRevoke - """ - id: ID! - """ - Autogenerated input type of ClusterAgentTokenRevoke - """ - organizationId: ID! +"""Autogenerated input type of ClusterAgentTokenRevoke""" + clientMutationId: String +"""Autogenerated input type of ClusterAgentTokenRevoke""" + id: ID! +"""Autogenerated input type of ClusterAgentTokenRevoke""" + organizationId: ID! } -""" -Autogenerated return type of ClusterAgentTokenRevoke. -""" +"""Autogenerated return type of ClusterAgentTokenRevoke.""" type ClusterAgentTokenRevokePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedClusterAgentTokenId: ID! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedClusterAgentTokenId: ID! } -""" -Autogenerated input type of ClusterAgentTokenUpdate -""" +"""Autogenerated input type of ClusterAgentTokenUpdate""" input ClusterAgentTokenUpdateInput { - """ - Autogenerated input type of ClusterAgentTokenUpdate - """ - clientMutationId: String - """ - Autogenerated input type of ClusterAgentTokenUpdate - """ - id: ID! - """ - Autogenerated input type of ClusterAgentTokenUpdate - """ - organizationId: ID! - """ - Autogenerated input type of ClusterAgentTokenUpdate - """ - description: String! - """ - Autogenerated input type of ClusterAgentTokenUpdate - """ - jobTokensEnabled: Boolean - """ - Autogenerated input type of ClusterAgentTokenUpdate - """ - allowedIpAddresses: String -} - -""" -Autogenerated return type of ClusterAgentTokenUpdate. -""" +"""Autogenerated input type of ClusterAgentTokenUpdate""" + clientMutationId: String +"""Autogenerated input type of ClusterAgentTokenUpdate""" + id: ID! +"""Autogenerated input type of ClusterAgentTokenUpdate""" + organizationId: ID! +"""Autogenerated input type of ClusterAgentTokenUpdate""" + description: String! +"""Autogenerated input type of ClusterAgentTokenUpdate""" + jobTokensEnabled: Boolean +"""Autogenerated input type of ClusterAgentTokenUpdate""" + allowedIpAddresses: String +} + +"""Autogenerated return type of ClusterAgentTokenUpdate.""" type ClusterAgentTokenUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - clusterAgentToken: ClusterToken! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + clusterAgentToken: ClusterToken! } -type ClusterConnection implements Connection { - count: Int! - edges: [ClusterEdge] - pageInfo: PageInfo +type ClusterConnection implements Connection{ + count: Int! + edges: [ClusterEdge] + pageInfo: PageInfo } -""" -Autogenerated input type of ClusterCreate -""" +"""Autogenerated input type of ClusterCreate""" input ClusterCreateInput { - """ - Autogenerated input type of ClusterCreate - """ - clientMutationId: String - """ - Autogenerated input type of ClusterCreate - """ - organizationId: ID! - """ - Autogenerated input type of ClusterCreate - """ - name: String! - """ - Autogenerated input type of ClusterCreate - """ - description: String - """ - Autogenerated input type of ClusterCreate - """ - emoji: String - """ - Autogenerated input type of ClusterCreate - """ - color: String -} - -""" -Autogenerated return type of ClusterCreate. -""" +"""Autogenerated input type of ClusterCreate""" + clientMutationId: String +"""Autogenerated input type of ClusterCreate""" + organizationId: ID! +"""Autogenerated input type of ClusterCreate""" + name: String! +"""Autogenerated input type of ClusterCreate""" + description: String +"""Autogenerated input type of ClusterCreate""" + emoji: String +"""Autogenerated input type of ClusterCreate""" + color: String +} + +"""Autogenerated return type of ClusterCreate.""" type ClusterCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - cluster: Cluster! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + cluster: Cluster! } -""" -Autogenerated input type of ClusterDelete -""" +"""Autogenerated input type of ClusterDelete""" input ClusterDeleteInput { - """ - Autogenerated input type of ClusterDelete - """ - clientMutationId: String - """ - Autogenerated input type of ClusterDelete - """ - organizationId: ID! - """ - Autogenerated input type of ClusterDelete - """ - id: ID! +"""Autogenerated input type of ClusterDelete""" + clientMutationId: String +"""Autogenerated input type of ClusterDelete""" + organizationId: ID! +"""Autogenerated input type of ClusterDelete""" + id: ID! } -""" -Autogenerated return type of ClusterDelete. -""" +"""Autogenerated return type of ClusterDelete.""" type ClusterDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedClusterId: ID! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedClusterId: ID! } type ClusterEdge { - cursor: String! - node: Cluster + cursor: String! + node: Cluster } -""" -The different orders you can sort clusters by -""" +"""The different orders you can sort clusters by""" enum ClusterOrder { - """ - Order by name alphabetically - """ - NAME - """ - Order by the most recently created clusters first - """ - RECENTLY_CREATED +"""Order by name alphabetically""" + NAME +"""Order by the most recently created clusters first""" + RECENTLY_CREATED } type ClusterPermission { - actor: ClusterPermissionActor - """ - Whether the actor can add pipelines to this cluster - """ - can_add_pipelines: Boolean! - """ - Whether the actor can manage the associated cluster - """ - can_manage: Boolean! - """ - Whether the actor can see this cluster's tokens - """ - can_see_tokens: Boolean! - cluster: Cluster - id: ID! - """ - The public UUID for this cluster permission - """ - uuid: ID! -} - -""" -Actor to whom a cluster permission is applied -""" -union ClusterPermissionActor = OrganizationMember | Team + actor: ClusterPermissionActor +"""Whether the actor can add pipelines to this cluster""" + can_add_pipelines: Boolean! +"""Whether the actor can manage the associated cluster""" + can_manage: Boolean! +"""Whether the actor can see this cluster's tokens""" + can_see_tokens: Boolean! + cluster: Cluster + id: ID! +"""The public UUID for this cluster permission""" + uuid: ID! +} + +"""Actor to whom a cluster permission is applied""" +union ClusterPermissionActor =OrganizationMember | Team type ClusterQueue { - cluster: Cluster - createdBy: User - description: String - """ - States whether job dispatch is paused for this cluster queue - """ - dispatchPaused: Boolean! - """ - The time this queue was paused - """ - dispatchPausedAt: DateTime - """ - The user who paused this cluster queue - """ - dispatchPausedBy: User - """ - Note describing why job dispatch was paused for this cluster queue - """ - dispatchPausedNote: String - id: ID! - key: String! - """ - The public UUID for this cluster queue - """ - uuid: ID! -} - -type ClusterQueueConnection implements Connection { - count: Int! - edges: [ClusterQueueEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of ClusterQueueCreate -""" + cluster: Cluster + createdBy: User + description: String +"""States whether job dispatch is paused for this cluster queue""" + dispatchPaused: Boolean! +"""The time this queue was paused""" + dispatchPausedAt: DateTime +"""The user who paused this cluster queue""" + dispatchPausedBy: User +"""Note describing why job dispatch was paused for this cluster queue""" + dispatchPausedNote: String + id: ID! + key: String! +"""The public UUID for this cluster queue""" + uuid: ID! +} + +type ClusterQueueConnection implements Connection{ + count: Int! + edges: [ClusterQueueEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of ClusterQueueCreate""" input ClusterQueueCreateInput { - """ - Autogenerated input type of ClusterQueueCreate - """ - clientMutationId: String - """ - Autogenerated input type of ClusterQueueCreate - """ - organizationId: ID! - """ - Autogenerated input type of ClusterQueueCreate - """ - clusterId: ID! - """ - Autogenerated input type of ClusterQueueCreate - """ - key: String! - """ - Autogenerated input type of ClusterQueueCreate - """ - description: String -} - -""" -Autogenerated return type of ClusterQueueCreate. -""" +"""Autogenerated input type of ClusterQueueCreate""" + clientMutationId: String +"""Autogenerated input type of ClusterQueueCreate""" + organizationId: ID! +"""Autogenerated input type of ClusterQueueCreate""" + clusterId: ID! +"""Autogenerated input type of ClusterQueueCreate""" + key: String! +"""Autogenerated input type of ClusterQueueCreate""" + description: String +} + +"""Autogenerated return type of ClusterQueueCreate.""" type ClusterQueueCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - clusterQueue: ClusterQueue! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + clusterQueue: ClusterQueue! } -""" -Autogenerated input type of ClusterQueueDelete -""" +"""Autogenerated input type of ClusterQueueDelete""" input ClusterQueueDeleteInput { - """ - Autogenerated input type of ClusterQueueDelete - """ - clientMutationId: String - """ - Autogenerated input type of ClusterQueueDelete - """ - organizationId: ID! - """ - Autogenerated input type of ClusterQueueDelete - """ - id: ID! +"""Autogenerated input type of ClusterQueueDelete""" + clientMutationId: String +"""Autogenerated input type of ClusterQueueDelete""" + organizationId: ID! +"""Autogenerated input type of ClusterQueueDelete""" + id: ID! } -""" -Autogenerated return type of ClusterQueueDelete. -""" +"""Autogenerated return type of ClusterQueueDelete.""" type ClusterQueueDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedClusterQueueId: ID! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedClusterQueueId: ID! } type ClusterQueueEdge { - cursor: String! - node: ClusterQueue + cursor: String! + node: ClusterQueue } -""" -The different orders you can sort cluster queues by -""" +"""The different orders you can sort cluster queues by""" enum ClusterQueueOrder { - """ - Order by key alphabetically - """ - KEY - """ - Order by the most recently created cluster queues first - """ - RECENTLY_CREATED +"""Order by key alphabetically""" + KEY +"""Order by the most recently created cluster queues first""" + RECENTLY_CREATED } -""" -Autogenerated input type of ClusterQueuePauseDispatch -""" +"""Autogenerated input type of ClusterQueuePauseDispatch""" input ClusterQueuePauseDispatchInput { - """ - Autogenerated input type of ClusterQueuePauseDispatch - """ - clientMutationId: String - """ - Autogenerated input type of ClusterQueuePauseDispatch - """ - id: ID! - """ - Autogenerated input type of ClusterQueuePauseDispatch - """ - note: String +"""Autogenerated input type of ClusterQueuePauseDispatch""" + clientMutationId: String +"""Autogenerated input type of ClusterQueuePauseDispatch""" + id: ID! +"""Autogenerated input type of ClusterQueuePauseDispatch""" + note: String } -""" -Autogenerated return type of ClusterQueuePauseDispatch. -""" +"""Autogenerated return type of ClusterQueuePauseDispatch.""" type ClusterQueuePauseDispatchPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - queue: ClusterQueue! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + queue: ClusterQueue! } -""" -Autogenerated input type of ClusterQueueResumeDispatch -""" +"""Autogenerated input type of ClusterQueueResumeDispatch""" input ClusterQueueResumeDispatchInput { - """ - Autogenerated input type of ClusterQueueResumeDispatch - """ - clientMutationId: String - """ - Autogenerated input type of ClusterQueueResumeDispatch - """ - id: ID! +"""Autogenerated input type of ClusterQueueResumeDispatch""" + clientMutationId: String +"""Autogenerated input type of ClusterQueueResumeDispatch""" + id: ID! } -""" -Autogenerated return type of ClusterQueueResumeDispatch. -""" +"""Autogenerated return type of ClusterQueueResumeDispatch.""" type ClusterQueueResumeDispatchPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - queue: ClusterQueue! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + queue: ClusterQueue! } -""" -Autogenerated input type of ClusterQueueUpdate -""" +"""Autogenerated input type of ClusterQueueUpdate""" input ClusterQueueUpdateInput { - """ - Autogenerated input type of ClusterQueueUpdate - """ - clientMutationId: String - """ - Autogenerated input type of ClusterQueueUpdate - """ - organizationId: ID! - """ - Autogenerated input type of ClusterQueueUpdate - """ - id: ID! - """ - Autogenerated input type of ClusterQueueUpdate - """ - description: String +"""Autogenerated input type of ClusterQueueUpdate""" + clientMutationId: String +"""Autogenerated input type of ClusterQueueUpdate""" + organizationId: ID! +"""Autogenerated input type of ClusterQueueUpdate""" + id: ID! +"""Autogenerated input type of ClusterQueueUpdate""" + description: String } -""" -Autogenerated return type of ClusterQueueUpdate. -""" +"""Autogenerated return type of ClusterQueueUpdate.""" type ClusterQueueUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - clusterQueue: ClusterQueue! -} - -""" -A token used to connect an agent in cluster to Buildkite -""" -type ClusterToken implements Node { - """ - A list of CIDR-notation IPv4 addresses from which agents can use this token. Please note that this feature is not yet available to all organizations - """ - allowedIpAddresses: String - cluster: Cluster - createdBy: User - """ - A description about what this cluster agent token is used for - """ - description: String - id: ID! - """ - Agents registered with this token will use a unique token for each job. Please note that this feature is not yet available to all organizations - """ - jobTokensEnabled: Boolean - """ - The token value used to register a new agent to this tokens cluster. This will soon return an empty string before we finally remove this field. - """ - token: String! - """ - The public UUID for this cluster token - """ - uuid: ID! -} - -""" -Autogenerated input type of ClusterUpdate -""" +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + clusterQueue: ClusterQueue! +} + +"""A token used to connect an agent in cluster to Buildkite""" +type ClusterToken implements Node{ +"""A list of CIDR-notation IPv4 addresses from which agents can use this token. Please note that this feature is not yet available to all organizations""" + allowedIpAddresses: String + cluster: Cluster + createdBy: User +"""A description about what this cluster agent token is used for""" + description: String + id: ID! +"""Agents registered with this token will use a unique token for each job. Please note that this feature is not yet available to all organizations""" + jobTokensEnabled: Boolean +"""The token value used to register a new agent to this tokens cluster. This will soon return an empty string before we finally remove this field.""" + token: String! +"""The public UUID for this cluster token""" + uuid: ID! +} + +"""Autogenerated input type of ClusterUpdate""" input ClusterUpdateInput { - """ - Autogenerated input type of ClusterUpdate - """ - clientMutationId: String - """ - Autogenerated input type of ClusterUpdate - """ - organizationId: ID! - """ - Autogenerated input type of ClusterUpdate - """ - id: ID! - """ - Autogenerated input type of ClusterUpdate - """ - name: String - """ - Autogenerated input type of ClusterUpdate - """ - description: String - """ - Autogenerated input type of ClusterUpdate - """ - emoji: String - """ - Autogenerated input type of ClusterUpdate - """ - color: String - """ - Autogenerated input type of ClusterUpdate - """ - defaultQueueId: ID -} - -""" -Autogenerated return type of ClusterUpdate. -""" +"""Autogenerated input type of ClusterUpdate""" + clientMutationId: String +"""Autogenerated input type of ClusterUpdate""" + organizationId: ID! +"""Autogenerated input type of ClusterUpdate""" + id: ID! +"""Autogenerated input type of ClusterUpdate""" + name: String +"""Autogenerated input type of ClusterUpdate""" + description: String +"""Autogenerated input type of ClusterUpdate""" + emoji: String +"""Autogenerated input type of ClusterUpdate""" + color: String +"""Autogenerated input type of ClusterUpdate""" + defaultQueueId: ID +} + +"""Autogenerated return type of ClusterUpdate.""" type ClusterUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - cluster: Cluster! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + cluster: Cluster! } interface Connection { - count: Int! - pageInfo: PageInfo + count: Int! + pageInfo: PageInfo } -""" -An ISO-8601 encoded UTC date string -""" +"""An ISO-8601 encoded UTC date string""" scalar DateTime type Dependency { - """ - Is this dependency allowed to fail - """ - allowFailure: Boolean! - id: ID! - """ - The step key or step identifier that this step depends on - """ - key: String - """ - The UUID for this dependency - """ - uuid: ID! -} - -type DependencyConnection implements Connection { - count: Int! - edges: [DependencyEdge] - pageInfo: PageInfo +"""Is this dependency allowed to fail""" + allowFailure: Boolean! + id: ID! +"""The step key or step identifier that this step depends on""" + key: String +"""The UUID for this dependency""" + uuid: ID! +} + +type DependencyConnection implements Connection{ + count: Int! + edges: [DependencyEdge] + pageInfo: PageInfo } type DependencyEdge { - cursor: String! - node: Dependency + cursor: String! + node: Dependency } -""" -A job dispatch for a particular Organization -""" +"""A job dispatch for a particular Organization""" type Dispatch { - id: ID! - """ - The public UUID for this organization dispatch - """ - uuid: String! + id: ID! +"""The public UUID for this organization dispatch""" + uuid: String! } -""" -An email address -""" -type Email implements Node { - """ - The email address - """ - address: String! - id: ID! - """ - Whether the email address is the user's primary address - """ - primary: Boolean! - """ - The public UUID for this email - """ - uuid: ID! - """ - Whether the email address has been verified by the user - """ - verified: Boolean! -} - -type EmailConnection implements Connection { - count: Int! - edges: [EmailEdge] - pageInfo: PageInfo +"""An email address""" +type Email implements Node{ +"""The email address""" + address: String! + id: ID! +"""Whether the email address is the user's primary address""" + primary: Boolean! +"""The public UUID for this email""" + uuid: ID! +"""Whether the email address has been verified by the user""" + verified: Boolean! } -""" -Autogenerated input type of EmailCreate -""" +type EmailConnection implements Connection{ + count: Int! + edges: [EmailEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of EmailCreate""" input EmailCreateInput { - """ - Autogenerated input type of EmailCreate - """ - clientMutationId: String - """ - Autogenerated input type of EmailCreate - """ - address: String! +"""Autogenerated input type of EmailCreate""" + clientMutationId: String +"""Autogenerated input type of EmailCreate""" + address: String! } -""" -Autogenerated return type of EmailCreate. -""" +"""Autogenerated return type of EmailCreate.""" type EmailCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - emailEdge: EmailEdge! - viewer: Viewer! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + emailEdge: EmailEdge! + viewer: Viewer! } type EmailEdge { - cursor: String! - node: Email + cursor: String! + node: Email } -""" -Autogenerated input type of EmailResendVerification -""" +"""Autogenerated input type of EmailResendVerification""" input EmailResendVerificationInput { - """ - Autogenerated input type of EmailResendVerification - """ - clientMutationId: String - """ - Autogenerated input type of EmailResendVerification - """ - id: ID! +"""Autogenerated input type of EmailResendVerification""" + clientMutationId: String +"""Autogenerated input type of EmailResendVerification""" + id: ID! } -""" -Autogenerated return type of EmailResendVerification. -""" +"""Autogenerated return type of EmailResendVerification.""" type EmailResendVerificationPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - email: Email! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + email: Email! } -""" -A shared GraphQL query -""" +"""A shared GraphQL query""" type GraphQLSnippet { - """ - When this GraphQL snippet was created - """ - createdAt: DateTime! - id: ID! - """ - The default operation name for this snippet - """ - operationName: String - """ - The query of this GraphQL snippet - """ - query: String! - """ - The URL for the GraphQL snippet - """ - url: String! - """ - The public UUID for this snippet - """ - uuid: ID! -} - -""" -Autogenerated input type of GraphQLSnippetCreate -""" +"""When this GraphQL snippet was created""" + createdAt: DateTime! + id: ID! +"""The default operation name for this snippet""" + operationName: String +"""The query of this GraphQL snippet""" + query: String! +"""The URL for the GraphQL snippet""" + url: String! +"""The public UUID for this snippet""" + uuid: ID! +} + +"""Autogenerated input type of GraphQLSnippetCreate""" input GraphQLSnippetCreateInput { - """ - Autogenerated input type of GraphQLSnippetCreate - """ - clientMutationId: String - """ - Autogenerated input type of GraphQLSnippetCreate - """ - query: String! - """ - Autogenerated input type of GraphQLSnippetCreate - """ - operationName: ID +"""Autogenerated input type of GraphQLSnippetCreate""" + clientMutationId: String +"""Autogenerated input type of GraphQLSnippetCreate""" + query: String! +"""Autogenerated input type of GraphQLSnippetCreate""" + operationName: ID } -""" -Autogenerated return type of GraphQLSnippetCreate. -""" +"""Autogenerated return type of GraphQLSnippetCreate.""" type GraphQLSnippetCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - graphQLSnippet: GraphQLSnippet! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + graphQLSnippet: GraphQLSnippet! } -""" -Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) input value will be accepted as an ID. -""" +"""Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) input value will be accepted as an ID.""" scalar ID -""" -An ISO 8601-encoded date -""" +"""An ISO 8601-encoded date""" scalar ISO8601Date -""" -Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. -""" +"""Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.""" scalar Int -""" -Represents non-fractional signed whole numeric values. +"""Represents non-fractional signed whole numeric values. `JSInt` can represent values between -(2^53) + 1 and 2^53 - 1. """ scalar JSInt -""" -A blob of JSON represented as a pretty formatted string -""" +"""A blob of JSON represented as a pretty formatted string""" scalar JSON -""" -Kinds of jobs that can exist on a build -""" -union Job = JobTypeBlock | JobTypeCommand | JobTypeTrigger | JobTypeWait +"""Kinds of jobs that can exist on a build""" +union Job =JobTypeBlock | JobTypeCommand | JobTypeTrigger | JobTypeWait -""" -Concurrency configuration for a job -""" +"""Concurrency configuration for a job""" type JobConcurrency { - """ - The concurrency group - """ - group: String! - """ - The maximum amount of jobs in the concurrency that are allowed to run at any given time - """ - limit: Int! +"""The concurrency group""" + group: String! +"""The maximum amount of jobs in the concurrency that are allowed to run at any given time""" + limit: Int! } -""" -Searching for concurrency groups on jobs -""" +"""Searching for concurrency groups on jobs""" input JobConcurrencySearch { - """ - Searching for concurrency groups on jobs - """ - group: [String!] +"""Searching for concurrency groups on jobs""" + group: [String!] } -type JobConnection implements Connection { - count: Int! - edges: [JobEdge] - pageInfo: PageInfo +type JobConnection implements Connection{ + count: Int! + edges: [JobEdge] + pageInfo: PageInfo } type JobEdge { - cursor: String! - node: Job + cursor: String! + node: Job } interface JobEvent { - actor: JobEventActor! - id: ID! - job: JobTypeCommand! - timestamp: DateTime! - type: JobEventType! - uuid: ID! + actor: JobEventActor! + id: ID! + job: JobTypeCommand! + timestamp: DateTime! + type: JobEventType! + uuid: ID! } -""" -The actor who was responsible for the job event -""" +"""The actor who was responsible for the job event""" type JobEventActor { - """ - The node corresponding to this actor if available - """ - node: JobEventActorNodeUnion - """ - The type of this actor - """ - type: JobEventActorType! - """ - The public UUID of this actor if available - """ - uuid: ID +"""The node corresponding to this actor if available""" + node: JobEventActorNodeUnion +"""The type of this actor""" + type: JobEventActorType! +"""The public UUID of this actor if available""" + uuid: ID } -""" -Actor types that can create events on a job -""" -union JobEventActorNodeUnion = Agent | Dispatch | User +"""Actor types that can create events on a job""" +union JobEventActorNodeUnion =Agent | Dispatch | User -""" -All the actors that can have created a job event -""" +"""All the actors that can have created a job event""" enum JobEventActorType { - """ - The actor was a user - """ - USER - """ - The actor was an agent - """ - AGENT - """ - The actor was the system - """ - SYSTEM - """ - The actor was the dispatcher - """ - DISPATCH -} - -""" -An event created when the dispatcher assigns the job to an agent -""" -type JobEventAssigned implements JobEvent & Node { - """ - The actor that caused this event to occur - """ - actor: JobEventActor! - """ - The agent the job was assigned to - """ - assignedAgent: Agent! - id: ID! - """ - The job that this event belongs to - """ - job: JobTypeCommand! - """ - The time when the event occurred - """ - timestamp: DateTime! - """ - The type of event - """ - type: JobEventType! - """ - The public UUID for this job event - """ - uuid: ID! -} - -""" -An event created when the job creates new build steps via pipeline upload -""" -type JobEventBuildStepUploadCreated implements JobEvent & Node { - """ - The actor that caused this event to occur - """ - actor: JobEventActor! - buildStepUpload: BuildStepUpload! - id: ID! - """ - The job that this event belongs to - """ - job: JobTypeCommand! - """ - The time when the event occurred - """ - timestamp: DateTime! - """ - The type of event - """ - type: JobEventType! - """ - The public UUID for this job event - """ - uuid: ID! -} - -""" -An event created when the job is canceled -""" -type JobEventCanceled implements JobEvent & Node { - """ - The actor that caused this event to occur - """ - actor: JobEventActor! - exitStatus: JSInt! - id: ID! - """ - The job that this event belongs to - """ - job: JobTypeCommand! - """ - The termination signal which killed the command, if the command was killed - """ - signal: String - """ - If the termination signal was sent by the agent, the reason the agent took that action. If this field is null, and the `signal` field is not null, the command was killed by another process or by the operating system. - """ - signalReason: JobEventSignalReason - """ - The time when the event occurred - """ - timestamp: DateTime! - """ - The type of event - """ - type: JobEventType! - """ - The public UUID for this job event - """ - uuid: ID! -} - -type JobEventConnection implements Connection { - count: Int! - edges: [JobEventEdge] - pageInfo: PageInfo +"""The actor was a user""" + USER +"""The actor was an agent""" + AGENT +"""The actor was the system""" + SYSTEM +"""The actor was the dispatcher""" + DISPATCH +} + +"""An event created when the dispatcher assigns the job to an agent""" +type JobEventAssigned implements JobEvent & Node{ +"""The actor that caused this event to occur""" + actor: JobEventActor! +"""The agent the job was assigned to""" + assignedAgent: Agent! + id: ID! +"""The job that this event belongs to""" + job: JobTypeCommand! +"""The time when the event occurred""" + timestamp: DateTime! +"""The type of event""" + type: JobEventType! +"""The public UUID for this job event""" + uuid: ID! +} + +"""An event created when the job creates new build steps via pipeline upload""" +type JobEventBuildStepUploadCreated implements JobEvent & Node{ +"""The actor that caused this event to occur""" + actor: JobEventActor! + buildStepUpload: BuildStepUpload! + id: ID! +"""The job that this event belongs to""" + job: JobTypeCommand! +"""The time when the event occurred""" + timestamp: DateTime! +"""The type of event""" + type: JobEventType! +"""The public UUID for this job event""" + uuid: ID! +} + +"""An event created when the job is canceled""" +type JobEventCanceled implements JobEvent & Node{ +"""The actor that caused this event to occur""" + actor: JobEventActor! + exitStatus: JSInt! + id: ID! +"""The job that this event belongs to""" + job: JobTypeCommand! +"""The termination signal which killed the command, if the command was killed""" + signal: String +"""If the termination signal was sent by the agent, the reason the agent took that action. If this field is null, and the `signal` field is not null, the command was killed by another process or by the operating system.""" + signalReason: JobEventSignalReason +"""The time when the event occurred""" + timestamp: DateTime! +"""The type of event""" + type: JobEventType! +"""The public UUID for this job event""" + uuid: ID! +} + +type JobEventConnection implements Connection{ + count: Int! + edges: [JobEventEdge] + pageInfo: PageInfo } type JobEventEdge { - cursor: String! - node: JobEvent! -} - -""" -An event created when the job is finished -""" -type JobEventFinished implements JobEvent & Node { - """ - The actor that caused this event to occur - """ - actor: JobEventActor! - """ - The exit status returned by the command on the agent. A value of `-1` indicates either that the agent was lost or the process was killed. If the process was killed, the `signal` field will be non-null. - """ - exitStatus: JSInt! - id: ID! - """ - The job that this event belongs to - """ - job: JobTypeCommand! - """ - The termination signal which killed the command, if the command was killed - """ - signal: String - """ - If the termination signal was sent by the agent, the reason the agent took that action. If this field is null, and the `signal` field is not null, the command was killed by another process or by the operating system. - """ - signalReason: JobEventSignalReason - """ - The time when the event occurred - """ - timestamp: DateTime! - """ - The type of event - """ - type: JobEventType! - """ - The public UUID for this job event - """ - uuid: ID! -} - -""" -A generic event type that doesn't have any additional meta-information associated with the event -""" -type JobEventGeneric implements JobEvent & Node { - """ - The actor that caused this event to occur - """ - actor: JobEventActor! - id: ID! - """ - The job that this event belongs to - """ - job: JobTypeCommand! - """ - The time when the event occurred - """ - timestamp: DateTime! - """ - The type of event - """ - type: JobEventType! - """ - The public UUID for this job event - """ - uuid: ID! -} - -""" -An event created when the job is retried -""" -type JobEventRetried implements JobEvent & Node { - """ - The actor that caused this event to occur - """ - actor: JobEventActor! - automaticRule: JobRetryRuleAutomatic - id: ID! - """ - The job that this event belongs to - """ - job: JobTypeCommand! - retriedInJob: JobTypeCommand - """ - The time when the event occurred - """ - timestamp: DateTime! - """ - The type of event - """ - type: JobEventType! - """ - The public UUID for this job event - """ - uuid: ID! -} - -""" -The reason why a signal was sent to the job's process, or why the process did not start -""" + cursor: String! + node: JobEvent! +} + +"""An event created when the job is finished""" +type JobEventFinished implements JobEvent & Node{ +"""The actor that caused this event to occur""" + actor: JobEventActor! +"""The exit status returned by the command on the agent. A value of `-1` indicates either that the agent was lost or the process was killed. If the process was killed, the `signal` field will be non-null.""" + exitStatus: JSInt! + id: ID! +"""The job that this event belongs to""" + job: JobTypeCommand! +"""The termination signal which killed the command, if the command was killed""" + signal: String +"""If the termination signal was sent by the agent, the reason the agent took that action. If this field is null, and the `signal` field is not null, the command was killed by another process or by the operating system.""" + signalReason: JobEventSignalReason +"""The time when the event occurred""" + timestamp: DateTime! +"""The type of event""" + type: JobEventType! +"""The public UUID for this job event""" + uuid: ID! +} + +"""A generic event type that doesn't have any additional meta-information associated with the event""" +type JobEventGeneric implements JobEvent & Node{ +"""The actor that caused this event to occur""" + actor: JobEventActor! + id: ID! +"""The job that this event belongs to""" + job: JobTypeCommand! +"""The time when the event occurred""" + timestamp: DateTime! +"""The type of event""" + type: JobEventType! +"""The public UUID for this job event""" + uuid: ID! +} + +"""An event created when the job is retried""" +type JobEventRetried implements JobEvent & Node{ +"""The actor that caused this event to occur""" + actor: JobEventActor! + automaticRule: JobRetryRuleAutomatic + id: ID! +"""The job that this event belongs to""" + job: JobTypeCommand! + retriedInJob: JobTypeCommand +"""The time when the event occurred""" + timestamp: DateTime! +"""The type of event""" + type: JobEventType! +"""The public UUID for this job event""" + uuid: ID! +} + +"""The reason why a signal was sent to the job's process, or why the process did not start""" enum JobEventSignalReason { - """ - The agent sent the signal to the process because the agent was stopped - """ - AGENT_STOP - """ - The agent sent the signal to the process because the job was canceled - """ - CANCEL - """ - The agent was unable to start the job process, often due to memory or resource constraints. Note that in this case, no signal was sent to the process, it simply never started. - """ - PROCESS_RUN_ERROR - """ - The agent pre-bootstrap hook refused the job. Note that in this case, no signal was sent to the process, the bootstrap was not run at all. - """ - AGENT_REFUSED -} - -""" -An event created when the job is timed out -""" -type JobEventTimedOut implements JobEvent & Node { - """ - The actor that caused this event to occur - """ - actor: JobEventActor! - exitStatus: JSInt! - id: ID! - """ - The job that this event belongs to - """ - job: JobTypeCommand! - """ - The termination signal which killed the command, if the command was killed - """ - signal: String - """ - If the termination signal was sent by the agent, the reason the agent took that action. If this field is null, and the `signal` field is not null, the command was killed by another process or by the operating system. - """ - signalReason: JobEventSignalReason - """ - The time when the event occurred - """ - timestamp: DateTime! - """ - The type of event - """ - type: JobEventType! - """ - The public UUID for this job event - """ - uuid: ID! -} - -""" -All the possible types of events that happen to a Job -""" +"""The agent sent the signal to the process because the agent was stopped""" + AGENT_STOP +"""The agent sent the signal to the process because the job was canceled""" + CANCEL +"""The agent was unable to start the job process, often due to memory or resource constraints. Note that in this case, no signal was sent to the process, it simply never started.""" + PROCESS_RUN_ERROR +"""The agent pre-bootstrap hook refused the job. Note that in this case, no signal was sent to the process, the bootstrap was not run at all.""" + AGENT_REFUSED +} + +"""An event created when the job is timed out""" +type JobEventTimedOut implements JobEvent & Node{ +"""The actor that caused this event to occur""" + actor: JobEventActor! + exitStatus: JSInt! + id: ID! +"""The job that this event belongs to""" + job: JobTypeCommand! +"""The termination signal which killed the command, if the command was killed""" + signal: String +"""If the termination signal was sent by the agent, the reason the agent took that action. If this field is null, and the `signal` field is not null, the command was killed by another process or by the operating system.""" + signalReason: JobEventSignalReason +"""The time when the event occurred""" + timestamp: DateTime! +"""The type of event""" + type: JobEventType! +"""The public UUID for this job event""" + uuid: ID! +} + +"""All the possible types of events that happen to a Job""" enum JobEventType { - """ - The Job was assigned to an agent - """ - ASSIGNED - """ - The agent took too long to accept the job - """ - ASSIGNED_EXPIRED - """ - The Job was accepted by an agent - """ - ACCEPTED - """ - The agent took too long to start the job - """ - ACCEPTED_EXPIRED - """ - The Job was started by an agent - """ - STARTED - """ - The Job was finished by an agent - """ - FINISHED - """ - The Job was canceled - """ - CANCELED - """ - The Job was timed out - """ - TIMED_OUT - """ - The Job was retried either automatically or by a user - """ - RETRIED - """ - The Job was changed - """ - CHANGED - """ - The Job was unblocked by a user - """ - UNBLOCKED - """ - The Job was scheduled - """ - SCHEDULED - """ - The Job sent a notification - """ - NOTIFICATION - """ - The Job was marked for cancelation by a user - """ - CANCELATION - """ - The Job is limited by a concurrency group - """ - LIMITED - """ - The Job uploaded steps to the current build - """ - BUILD_STEP_UPLOAD_CREATED - """ - The Job expired before it was started on an agent - """ - EXPIRED - """ - The agent was stopped while processing this job - """ - AGENT_STOPPED - """ - The agent disconnected while processing this job - """ - AGENT_DISCONNECTED - """ - The agent was lost while processing this job - """ - AGENT_LOST +"""The Job was assigned to an agent""" + ASSIGNED +"""The agent took too long to accept the job""" + ASSIGNED_EXPIRED +"""The Job was accepted by an agent""" + ACCEPTED +"""The agent took too long to start the job""" + ACCEPTED_EXPIRED +"""The Job was started by an agent""" + STARTED +"""The Job was finished by an agent""" + FINISHED +"""The Job was canceled""" + CANCELED +"""The Job was timed out""" + TIMED_OUT +"""The Job was retried either automatically or by a user""" + RETRIED +"""The Job was changed""" + CHANGED +"""The Job was unblocked by a user""" + UNBLOCKED +"""The Job was scheduled""" + SCHEDULED +"""The Job sent a notification""" + NOTIFICATION +"""The Job was marked for cancelation by a user""" + CANCELATION +"""The Job is limited by a concurrency group""" + LIMITED +"""The Job uploaded steps to the current build""" + BUILD_STEP_UPLOAD_CREATED +"""The Job expired before it was started on an agent""" + EXPIRED +"""The agent was stopped while processing this job""" + AGENT_STOPPED +"""The agent disconnected while processing this job""" + AGENT_DISCONNECTED +"""The agent was lost while processing this job""" + AGENT_LOST } interface JobInterface { - retried: Boolean! - retriedBy: User - retriesCount: Int - retrySource: Job - retryType: JobRetryTypes - uuid: String! + retried: Boolean! + retriedBy: User + retriesCount: Int + retrySource: Job + retryType: JobRetryTypes + uuid: String! } -""" -A record of job minutes usage, aggregated by day and pipeline. -""" -type JobMinutesUsage implements ResourceUsageInterface { - aggregatedOn: ISO8601Date! - pipeline: Pipeline - pipelineId: ID! - """ - The recorded usage in seconds. For billing purposes, seconds are summed for a billing period and rounded down to the nearest minute. - """ - seconds: Int! +"""A record of job minutes usage, aggregated by day and pipeline.""" +type JobMinutesUsage implements ResourceUsageInterface{ + aggregatedOn: ISO8601Date! + pipeline: Pipeline + pipelineId: ID! +"""The recorded usage in seconds. For billing purposes, seconds are summed for a billing period and rounded down to the nearest minute.""" + seconds: Int! } -""" -The different orders you can sort jobs by -""" +"""The different orders you can sort jobs by""" enum JobOrder { - """ - Order by the most recently assigned jobs first - """ - RECENTLY_ASSIGNED - """ - Order by the most recently created jobs first - """ - RECENTLY_CREATED +"""Order by the most recently assigned jobs first""" + RECENTLY_ASSIGNED +"""Order by the most recently created jobs first""" + RECENTLY_CREATED } -""" -The priority with which a job will run -""" +"""The priority with which a job will run""" type JobPriority { - number: Int + number: Int } -""" -Search jobs by priority -""" +"""Search jobs by priority""" input JobPrioritySearch { - """ - Search jobs by priority - """ - number: [Int!] +"""Search jobs by priority""" + number: [Int!] } -""" -Automatic retry rule configuration -""" +"""Automatic retry rule configuration""" type JobRetryRuleAutomatic { - exitStatus: String - limit: String - signal: String - signalReason: String + exitStatus: String + limit: String + signal: String + signalReason: String } -""" -Retry Rules for a job -""" +"""Retry Rules for a job""" type JobRetryRules { - automatic: [JobRetryRuleAutomatic] - manual: Boolean + automatic: [JobRetryRuleAutomatic] + manual: Boolean } -""" -The retry types that can be made on a Job -""" +"""The retry types that can be made on a Job""" enum JobRetryTypes { - MANUAL - AUTOMATIC + MANUAL + AUTOMATIC } -""" -All the possible states a job can be in -""" +"""All the possible states a job can be in""" enum JobStates { - """ - The job has just been created and doesn't have a state yet - """ - PENDING - """ - The job is waiting on a `wait` step to finish - """ - WAITING - """ - The job was in a `WAITING` state when the build failed - """ - WAITING_FAILED - """ - The job is waiting on a `block` step to finish - """ - BLOCKED - """ - The job was in a `BLOCKED` state when the build failed - """ - BLOCKED_FAILED - """ - This `block` job has been manually unblocked - """ - UNBLOCKED - """ - This `block` job was in an `UNBLOCKED` state when the build failed - """ - UNBLOCKED_FAILED - """ - The job is waiting on a concurrency group check before becoming either `LIMITED` or `SCHEDULED` - """ - LIMITING - """ - The job is waiting for jobs with the same concurrency group to finish - """ - LIMITED - """ - The job is scheduled and waiting for an agent - """ - SCHEDULED - """ - The job has been assigned to an agent, and it's waiting for it to accept - """ - ASSIGNED - """ - The job was accepted by the agent, and now it's waiting to start running - """ - ACCEPTED - """ - The job is running - """ - RUNNING - """ - The job has finished - """ - FINISHED - """ - The job is currently canceling - """ - CANCELING - """ - The job was canceled - """ - CANCELED - """ - The job is timing out for taking too long - """ - TIMING_OUT - """ - The job timed out - """ - TIMED_OUT - """ - The job was skipped - """ - SKIPPED - """ - The jobs configuration means that it can't be run - """ - BROKEN - """ - The job expired before it was started on an agent - """ - EXPIRED -} - -""" -Searching for jobs based on step information -""" +"""The job has just been created and doesn't have a state yet""" + PENDING +"""The job is waiting on a `wait` step to finish""" + WAITING +"""The job was in a `WAITING` state when the build failed""" + WAITING_FAILED +"""The job is waiting on a `block` step to finish""" + BLOCKED +"""The job was in a `BLOCKED` state when the build failed""" + BLOCKED_FAILED +"""This `block` job has been manually unblocked""" + UNBLOCKED +"""This `block` job was in an `UNBLOCKED` state when the build failed""" + UNBLOCKED_FAILED +"""The job is waiting on a concurrency group check before becoming either `LIMITED` or `SCHEDULED`""" + LIMITING +"""The job is waiting for jobs with the same concurrency group to finish""" + LIMITED +"""The job is scheduled and waiting for an agent""" + SCHEDULED +"""The job has been assigned to an agent, and it's waiting for it to accept""" + ASSIGNED +"""The job was accepted by the agent, and now it's waiting to start running""" + ACCEPTED +"""The job is running""" + RUNNING +"""The job has finished""" + FINISHED +"""The job is currently canceling""" + CANCELING +"""The job was canceled""" + CANCELED +"""The job is timing out for taking too long""" + TIMING_OUT +"""The job timed out""" + TIMED_OUT +"""The job was skipped""" + SKIPPED +"""The jobs configuration means that it can't be run""" + BROKEN +"""The job expired before it was started on an agent""" + EXPIRED +} + +"""Searching for jobs based on step information""" input JobStepSearch { - """ - Searching for jobs based on step information - """ - key: [String!] -} - -""" -A type of job that requires a user to unblock it before proceeding in a build pipeline -""" -type JobTypeBlock implements JobInterface & Node { - """ - The build that this job is a part of - """ - build: Build - id: ID! - """ - Whether or not this job can be unblocked yet (may be waiting on another job to finish) - """ - isUnblockable: Boolean - """ - The label of this block step - """ - label: String - """ - If this job has been retried - """ - retried: Boolean! - """ - The user that retried this job - """ - retriedBy: User - """ - The number of times the job has been retried - """ - retriesCount: Int - """ - The job that was retried to create this job - """ - retrySource: Job - """ - The type of retry that was performed on this job - """ - retryType: JobRetryTypes - """ - The state of the job - """ - state: JobStates! - """ - The step that defined this job. Some older jobs in the system may not have an associated step - """ - step: StepInput - """ - The time when the job was created - """ - unblockedAt: DateTime - """ - The user that unblocked this job - """ - unblockedBy: User - """ - The UUID for this job - """ - uuid: String! -} - -""" -Autogenerated input type of JobTypeBlockUnblock -""" +"""Searching for jobs based on step information""" + key: [String!] +} + +"""A type of job that requires a user to unblock it before proceeding in a build pipeline""" +type JobTypeBlock implements JobInterface & Node{ +"""The build that this job is a part of""" + build: Build + id: ID! +"""Whether or not this job can be unblocked yet (may be waiting on another job to finish)""" + isUnblockable: Boolean +"""The label of this block step""" + label: String +"""If this job has been retried""" + retried: Boolean! +"""The user that retried this job""" + retriedBy: User +"""The number of times the job has been retried""" + retriesCount: Int +"""The job that was retried to create this job""" + retrySource: Job +"""The type of retry that was performed on this job""" + retryType: JobRetryTypes +"""The state of the job""" + state: JobStates! +"""The step that defined this job. Some older jobs in the system may not have an associated step""" + step: StepInput +"""The time when the job was created""" + unblockedAt: DateTime +"""The user that unblocked this job""" + unblockedBy: User +"""The UUID for this job""" + uuid: String! +} + +"""Autogenerated input type of JobTypeBlockUnblock""" input JobTypeBlockUnblockInput { - """ - Autogenerated input type of JobTypeBlockUnblock - """ - clientMutationId: String - """ - Autogenerated input type of JobTypeBlockUnblock - """ - id: ID! - """ - Autogenerated input type of JobTypeBlockUnblock - """ - fields: JSON +"""Autogenerated input type of JobTypeBlockUnblock""" + clientMutationId: String +"""Autogenerated input type of JobTypeBlockUnblock""" + id: ID! +"""Autogenerated input type of JobTypeBlockUnblock""" + fields: JSON } -""" -Autogenerated return type of JobTypeBlockUnblock. -""" +"""Autogenerated return type of JobTypeBlockUnblock.""" type JobTypeBlockUnblockPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - jobTypeBlock: JobTypeBlock! -} - -""" -A type of job that runs a command on an agent -""" -type JobTypeCommand implements JobInterface & Node { - """ - The agent that is running the job - """ - agent: Agent - """ - The ruleset used to find an agent to run this job - """ - agentQueryRules: [String!] - """ - Artifacts uploaded to this job - """ - artifacts(first: Int, last: Int): ArtifactConnection - """ - A glob of files to automatically upload after the job finishes - """ - automaticArtifactUploadPaths: String - """ - The build that this job is a part of - """ - build: Build - """ - The time when the job was cancelled - """ - canceledAt: DateTime - """ - The cluster of this job - """ - cluster: Cluster - """ - The cluster queue of this job - """ - clusterQueue: ClusterQueue - """ - The command the job will run - """ - command: String - """ - Concurrency information related to a job - """ - concurrency: JobConcurrency - """ - The time when the job was created - """ - createdAt: DateTime - """ - Environment variables for this job - """ - env: [String!] - """ - Job events - """ - events( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - ): JobEventConnection! - """ - The exit status returned by the command on the agent - """ - exitStatus: String - """ - The time when the job was expired - """ - expiredAt: DateTime - """ - The time when the job finished - """ - finishedAt: DateTime - id: ID! - """ - The label of the job - """ - label: String - """ - The matrix configuration values for this particular job - """ - matrix: JSON - """ - The index of this job within the parallel job group it is a part of. Null if this job is not part of a parallel job group. - """ - parallelGroupIndex: Int - """ - The total number of jobs in the parallel job group this job is a part of. Null if this job is not part of a parallel job group. - """ - parallelGroupTotal: Int - """ - If the job has finished and passed - """ - passed: Boolean! - """ - The pipeline that this job is a part of - """ - pipeline: Pipeline - """ - The priority of this job - """ - priority: JobPriority! - """ - If this job has been retried - """ - retried: Boolean! - """ - The user that retried this job - """ - retriedBy: User - """ - The number of times the job has been retried - """ - retriesCount: Int - """ - Job retry rules - """ - retryRules: JobRetryRules - """ - The job that was retried to create this job - """ - retrySource: Job - """ - The type of retry that was performed on this job - """ - retryType: JobRetryTypes - """ - The time when the job became available to be run by an agent - """ - runnableAt: DateTime - """ - The time when the job became scheduled for running - """ - scheduledAt: DateTime - """ - The termination signal which killed the command, if the command was killed - """ - signal: String - """ - If the termination signal was sent by the agent, the reason the agent took that action. If this field is null, and the `signal` field is not null, the command was killed by another process or by the operating system. - """ - signalReason: JobEventSignalReason - """ - If the job soft failed - """ - softFailed: Boolean! - """ - The time when the job started running - """ - startedAt: DateTime - """ - The state of the job - """ - state: JobStates! - """ - The step that defined this job. Some older jobs in the system may not have an associated step - """ - step: StepCommand - """ - The URL for the job - """ - url: String! - """ - The UUID for this job - """ - uuid: String! -} - -""" -Autogenerated input type of JobTypeCommandCancel -""" +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + jobTypeBlock: JobTypeBlock! +} + +"""A type of job that runs a command on an agent""" +type JobTypeCommand implements JobInterface & Node{ +"""The agent that is running the job""" + agent: Agent +"""The ruleset used to find an agent to run this job""" + agentQueryRules: [String!] +"""Artifacts uploaded to this job""" + artifacts( + first: Int + last: Int + ): ArtifactConnection +"""A glob of files to automatically upload after the job finishes""" + automaticArtifactUploadPaths: String +"""The build that this job is a part of""" + build: Build +"""The time when the job was cancelled""" + canceledAt: DateTime +"""The cluster of this job""" + cluster: Cluster +"""The cluster queue of this job""" + clusterQueue: ClusterQueue +"""The command the job will run""" + command: String +"""Concurrency information related to a job""" + concurrency: JobConcurrency +"""The time when the job was created""" + createdAt: DateTime +"""Environment variables for this job""" + env: [String!] +"""Job events""" + events( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + ): JobEventConnection! +"""The exit status returned by the command on the agent""" + exitStatus: String +"""The time when the job was expired""" + expiredAt: DateTime +"""The time when the job finished""" + finishedAt: DateTime + id: ID! +"""The label of the job""" + label: String +"""The matrix configuration values for this particular job""" + matrix: JSON +"""The index of this job within the parallel job group it is a part of. Null if this job is not part of a parallel job group.""" + parallelGroupIndex: Int +"""The total number of jobs in the parallel job group this job is a part of. Null if this job is not part of a parallel job group.""" + parallelGroupTotal: Int +"""If the job has finished and passed""" + passed: Boolean! +"""The pipeline that this job is a part of""" + pipeline: Pipeline +"""The priority of this job""" + priority: JobPriority! +"""If this job has been retried""" + retried: Boolean! +"""The user that retried this job""" + retriedBy: User +"""The number of times the job has been retried""" + retriesCount: Int +"""Job retry rules""" + retryRules: JobRetryRules +"""The job that was retried to create this job""" + retrySource: Job +"""The type of retry that was performed on this job""" + retryType: JobRetryTypes +"""The time when the job became available to be run by an agent""" + runnableAt: DateTime +"""The time when the job became scheduled for running""" + scheduledAt: DateTime +"""The termination signal which killed the command, if the command was killed""" + signal: String +"""If the termination signal was sent by the agent, the reason the agent took that action. If this field is null, and the `signal` field is not null, the command was killed by another process or by the operating system.""" + signalReason: JobEventSignalReason +"""If the job soft failed""" + softFailed: Boolean! +"""The time when the job started running""" + startedAt: DateTime +"""The state of the job""" + state: JobStates! +"""The step that defined this job. Some older jobs in the system may not have an associated step""" + step: StepCommand +"""The URL for the job""" + url: String! +"""The UUID for this job""" + uuid: String! +} + +"""Autogenerated input type of JobTypeCommandCancel""" input JobTypeCommandCancelInput { - """ - Autogenerated input type of JobTypeCommandCancel - """ - clientMutationId: String - """ - Autogenerated input type of JobTypeCommandCancel - """ - id: ID! +"""Autogenerated input type of JobTypeCommandCancel""" + clientMutationId: String +"""Autogenerated input type of JobTypeCommandCancel""" + id: ID! } -""" -Autogenerated return type of JobTypeCommandCancel. -""" +"""Autogenerated return type of JobTypeCommandCancel.""" type JobTypeCommandCancelPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - jobTypeCommand: JobTypeCommand! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + jobTypeCommand: JobTypeCommand! } -""" -Autogenerated input type of JobTypeCommandRetry -""" +"""Autogenerated input type of JobTypeCommandRetry""" input JobTypeCommandRetryInput { - """ - Autogenerated input type of JobTypeCommandRetry - """ - clientMutationId: String - """ - Autogenerated input type of JobTypeCommandRetry - """ - id: ID! +"""Autogenerated input type of JobTypeCommandRetry""" + clientMutationId: String +"""Autogenerated input type of JobTypeCommandRetry""" + id: ID! } -""" -Autogenerated return type of JobTypeCommandRetry. -""" +"""Autogenerated return type of JobTypeCommandRetry.""" type JobTypeCommandRetryPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - jobTypeCommand: JobTypeCommand! - retriedInJobTypeCommand: JobTypeCommand! -} - -""" -A type of job that triggers another build on a pipeline -""" -type JobTypeTrigger implements JobInterface & Node { - """ - The build that this job is a part of - """ - build: Build - id: ID! - """ - The label of this trigger step - """ - label: String - """ - If this job has been retried - """ - retried: Boolean! - """ - The user that retried this job - """ - retriedBy: User - """ - The number of times the job has been retried - """ - retriesCount: Int - """ - The job that was retried to create this job - """ - retrySource: Job - """ - The type of retry that was performed on this job - """ - retryType: JobRetryTypes - """ - The state of the job - """ - state: JobStates! - """ - The step that defined this job. Some older jobs in the system may not have an associated step - """ - step: StepTrigger - """ - The build that this job triggered - """ - triggered: Build - """ - The UUID for this job - """ - uuid: String! -} - -""" -A type of job that waits for all previous jobs to pass before proceeding the build pipeline -""" -type JobTypeWait implements JobInterface & Node { - """ - The build that this job is a part of - """ - build: Build - id: ID! - """ - The label of this wait step - """ - label: String - """ - If this job has been retried - """ - retried: Boolean! - """ - The user that retried this job - """ - retriedBy: User - """ - The number of times the job has been retried - """ - retriesCount: Int - """ - The job that was retried to create this job - """ - retrySource: Job - """ - The type of retry that was performed on this job - """ - retryType: JobRetryTypes - """ - The state of the job - """ - state: JobStates! - """ - The step that defined this job. Some older jobs in the system may not have an associated step - """ - step: StepWait - """ - The UUID for this job - """ - uuid: String! -} - -""" -All the possible types of jobs that can exist -""" +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + jobTypeCommand: JobTypeCommand! + retriedInJobTypeCommand: JobTypeCommand! +} + +"""A type of job that triggers another build on a pipeline""" +type JobTypeTrigger implements JobInterface & Node{ +"""The build that this job is a part of""" + build: Build + id: ID! +"""The label of this trigger step""" + label: String +"""If this job has been retried""" + retried: Boolean! +"""The user that retried this job""" + retriedBy: User +"""The number of times the job has been retried""" + retriesCount: Int +"""The job that was retried to create this job""" + retrySource: Job +"""The type of retry that was performed on this job""" + retryType: JobRetryTypes +"""The state of the job""" + state: JobStates! +"""The step that defined this job. Some older jobs in the system may not have an associated step""" + step: StepTrigger +"""The build that this job triggered""" + triggered: Build +"""The UUID for this job""" + uuid: String! +} + +"""A type of job that waits for all previous jobs to pass before proceeding the build pipeline""" +type JobTypeWait implements JobInterface & Node{ +"""The build that this job is a part of""" + build: Build + id: ID! +"""The label of this wait step""" + label: String +"""If this job has been retried""" + retried: Boolean! +"""The user that retried this job""" + retriedBy: User +"""The number of times the job has been retried""" + retriesCount: Int +"""The job that was retried to create this job""" + retrySource: Job +"""The type of retry that was performed on this job""" + retryType: JobRetryTypes +"""The state of the job""" + state: JobStates! +"""The step that defined this job. Some older jobs in the system may not have an associated step""" + step: StepWait +"""The UUID for this job""" + uuid: String! +} + +"""All the possible types of jobs that can exist""" enum JobTypes { - """ - A job that runs a command on an agent - """ - COMMAND - """ - A job that waits for all previous jobs to finish - """ - WAIT - """ - A job that blocks a pipeline from progressing until it's manually unblocked - """ - BLOCK - """ - A job that triggers another build on a pipeline - """ - TRIGGER +"""A job that runs a command on an agent""" + COMMAND +"""A job that waits for all previous jobs to finish""" + WAIT +"""A job that blocks a pipeline from progressing until it's manually unblocked""" + BLOCK +"""A job that triggers another build on a pipeline""" + TRIGGER } -""" -The root for mutations in this schema -""" +"""The root for mutations in this schema""" type Mutation { - """ - Instruct an agent to stop accepting new build jobs and shut itself down. - """ - agentStop( - """ - Parameters for AgentStop - """ - input: AgentStopInput! - ): AgentStopPayload - """ - Create a new agent registration token. - """ - agentTokenCreate( - """ - Parameters for AgentTokenCreate - """ - input: AgentTokenCreateInput! - ): AgentTokenCreatePayload - """ - Revoke an agent registration token. - """ - agentTokenRevoke( - """ - Parameters for AgentTokenRevoke - """ - input: AgentTokenRevokeInput! - ): AgentTokenRevokePayload - """ - Authorize an API Access Token Code generated by an API Application. Please note this mutation is private and cannot be executed externally. - """ - apiAccessTokenCodeAuthorize( - """ - Parameters for APIAccessTokenCodeAuthorizeMutation - """ - input: APIAccessTokenCodeAuthorizeMutationInput! - ): APIAccessTokenCodeAuthorizeMutationPayload - """ - Annotate a build with information to appear on the build page. - """ - buildAnnotate( - """ - Parameters for BuildAnnotate - """ - input: BuildAnnotateInput! - ): BuildAnnotatePayload - """ - Cancel a build. - """ - buildCancel( - """ - Parameters for BuildCancel - """ - input: BuildCancelInput! - ): BuildCancelPayload - """ - Create a build. - """ - buildCreate( - """ - Parameters for BuildCreate - """ - input: BuildCreateInput! - ): BuildCreatePayload - """ - Rebuild a build. - """ - buildRebuild( - """ - Parameters for BuildRebuild - """ - input: BuildRebuildInput! - ): BuildRebuildPayload - """ - Create a new cluster agent token - """ - clusterAgentTokenCreate( - """ - Parameters for ClusterAgentTokenCreate - """ - input: ClusterAgentTokenCreateInput! - ): ClusterAgentTokenCreatePayload - """ - Revokes a cluster agent token - """ - clusterAgentTokenRevoke( - """ - Parameters for ClusterAgentTokenRevoke - """ - input: ClusterAgentTokenRevokeInput! - ): ClusterAgentTokenRevokePayload - """ - Updates a cluster agent token - """ - clusterAgentTokenUpdate( - """ - Parameters for ClusterAgentTokenUpdate - """ - input: ClusterAgentTokenUpdateInput! - ): ClusterAgentTokenUpdatePayload - """ - Create a cluster. - """ - clusterCreate( - """ - Parameters for ClusterCreate - """ - input: ClusterCreateInput! - ): ClusterCreatePayload - """ - Delete a cluster. - """ - clusterDelete( - """ - Parameters for ClusterDelete - """ - input: ClusterDeleteInput! - ): ClusterDeletePayload - """ - Create a cluster queue. - """ - clusterQueueCreate( - """ - Parameters for ClusterQueueCreate - """ - input: ClusterQueueCreateInput! - ): ClusterQueueCreatePayload - """ - Delete a cluster queue. - """ - clusterQueueDelete( - """ - Parameters for ClusterQueueDelete - """ - input: ClusterQueueDeleteInput! - ): ClusterQueueDeletePayload - """ - This will prevent dispatch of jobs to agents on this queue. You can add an optional note describing the reason for pausing. - """ - clusterQueuePauseDispatch( - """ - Parameters for ClusterQueuePauseDispatch - """ - input: ClusterQueuePauseDispatchInput! - ): ClusterQueuePauseDispatchPayload - """ - This will resume dispatch of jobs on this queue. - """ - clusterQueueResumeDispatch( - """ - Parameters for ClusterQueueResumeDispatch - """ - input: ClusterQueueResumeDispatchInput! - ): ClusterQueueResumeDispatchPayload - """ - Updates a cluster queue. - """ - clusterQueueUpdate( - """ - Parameters for ClusterQueueUpdate - """ - input: ClusterQueueUpdateInput! - ): ClusterQueueUpdatePayload - """ - Updates a cluster. - """ - clusterUpdate( - """ - Parameters for ClusterUpdate - """ - input: ClusterUpdateInput! - ): ClusterUpdatePayload - """ - Add a new email address for the current user - """ - emailCreate( - """ - Parameters for EmailCreate - """ - input: EmailCreateInput! - ): EmailCreatePayload - """ - Resend a verification email. - """ - emailResendVerification( - """ - Parameters for EmailResendVerification - """ - input: EmailResendVerificationInput! - ): EmailResendVerificationPayload - """ - Create a GraphQL snippet. - """ - graphQLSnippetCreate( - """ - Parameters for GraphQLSnippetCreate - """ - input: GraphQLSnippetCreateInput! - ): GraphQLSnippetCreatePayload - """ - Unblocks a build's "Block pipeline" job. - """ - jobTypeBlockUnblock( - """ - Parameters for JobTypeBlockUnblock - """ - input: JobTypeBlockUnblockInput! - ): JobTypeBlockUnblockPayload - """ - Cancel a job. - """ - jobTypeCommandCancel( - """ - Parameters for JobTypeCommandCancel - """ - input: JobTypeCommandCancelInput! - ): JobTypeCommandCancelPayload - """ - Retry a job. - """ - jobTypeCommandRetry( - """ - Parameters for JobTypeCommandRetry - """ - input: JobTypeCommandRetryInput! - ): JobTypeCommandRetryPayload - """ - Dismisses a notice from the Buildkite UI. This mutation is idempotent so if you dismiss the same notice multiple times, it will return the original `dismissedAt` time - """ - noticeDismiss( - """ - Parameters for NoticeDismiss - """ - input: NoticeDismissInput! - ): NoticeDismissPayload - """ - Revokes access to an organization for a user's API access token. The organization can not be re-added to the same token, however the user can create a new token and add the organization to that token. - """ - organizationApiAccessTokenRevoke( - """ - Parameters for OrganizationAPIAccessTokenRevokeMutation - """ - input: OrganizationAPIAccessTokenRevokeMutationInput! - ): OrganizationAPIAccessTokenRevokeMutationPayload - """ - Sets an allowlist of IP addresses for API access to an organization. Please note that this is a beta feature and is not yet available to all organizations. - """ - organizationApiIpAllowlistUpdate( - """ - Parameters for OrganizationAPIIPAllowlistUpdateMutation - """ - input: OrganizationAPIIPAllowlistUpdateMutationInput! - ): OrganizationAPIIPAllowlistUpdateMutationPayload - """ - Send email invitations to this organization. - """ - organizationInvitationCreate( - """ - Parameters for OrganizationInvitationCreate - """ - input: OrganizationInvitationCreateInput! - ): OrganizationInvitationCreatePayload - """ - Resend an organization invitation email. - """ - organizationInvitationResend( - """ - Parameters for OrganizationInvitationResend - """ - input: OrganizationInvitationResendInput! - ): OrganizationInvitationResendPayload - """ - Revoke an invitation to an organization so that it can no longer be accepted. - """ - organizationInvitationRevoke( - """ - Parameters for OrganizationInvitationRevoke - """ - input: OrganizationInvitationRevokeInput! - ): OrganizationInvitationRevokePayload - """ - Remove a user from an organization. - """ - organizationMemberDelete( - """ - Parameters for OrganizationMemberDelete - """ - input: OrganizationMemberDeleteInput! - ): OrganizationMemberDeletePayload - """ - Change a user's role within an organization. - """ - organizationMemberUpdate( - """ - Parameters for OrganizationMemberUpdate - """ - input: OrganizationMemberUpdateInput! - ): OrganizationMemberUpdatePayload - """ - Archive a pipeline. - """ - pipelineArchive( - """ - Parameters for PipelineArchive - """ - input: PipelineArchiveInput! - ): PipelineArchivePayload - """ - Create a pipeline. - """ - pipelineCreate( - """ - Parameters for PipelineCreate - """ - input: PipelineCreateInput! - ): PipelineCreatePayload - """ - Create SCM webhooks for a pipeline. - """ - pipelineCreateWebhook( - """ - Parameters for PipelineCreateWebhook - """ - input: PipelineCreateWebhookInput! - ): PipelineCreateWebhookPayload - """ - Delete a pipeline. - """ - pipelineDelete( - """ - Parameters for PipelineDelete - """ - input: PipelineDeleteInput! - ): PipelineDeletePayload - """ - Favorite a pipeline. - """ - pipelineFavorite( - """ - Parameters for PipelineFavorite - """ - input: PipelineFavoriteInput! - ): PipelineFavoritePayload - """ - Rotate a pipeline's webhook URL. - - Note that the old webhook URL will stop working immediately and so must be updated quickly to avoid interruption. - """ - pipelineRotateWebhookURL( - """ - Parameters for PipelineRotateWebhookURL - """ - input: PipelineRotateWebhookURLInput! - ): PipelineRotateWebhookURLPayload - """ - Create a scheduled build on pipeline. - """ - pipelineScheduleCreate( - """ - Parameters for PipelineScheduleCreate - """ - input: PipelineScheduleCreateInput! - ): PipelineScheduleCreatePayload - """ - Delete a scheduled build on pipeline. - """ - pipelineScheduleDelete( - """ - Parameters for PipelineScheduleDelete - """ - input: PipelineScheduleDeleteInput! - ): PipelineScheduleDeletePayload - """ - Update a scheduled build on pipeline. - """ - pipelineScheduleUpdate( - """ - Parameters for PipelineScheduleUpdate - """ - input: PipelineScheduleUpdateInput! - ): PipelineScheduleUpdatePayload - """ - Unarchive a pipeline. - """ - pipelineUnarchive( - """ - Parameters for PipelineUnarchive - """ - input: PipelineUnarchiveInput! - ): PipelineUnarchivePayload - """ - Change the settings for a pipeline. - """ - pipelineUpdate( - """ - Parameters for PipelineUpdate - """ - input: PipelineUpdateInput! - ): PipelineUpdatePayload - """ - Create a SSO provider. - """ - ssoProviderCreate( - """ - Parameters for SSOProviderCreate - """ - input: SSOProviderCreateInput! - ): SSOProviderCreatePayload - """ - Delete a SSO provider. - """ - ssoProviderDelete( - """ - Parameters for SSOProviderDelete - """ - input: SSOProviderDeleteInput! - ): SSOProviderDeletePayload - """ - Disable a SSO provider. - """ - ssoProviderDisable( - """ - Parameters for SSOProviderDisable - """ - input: SSOProviderDisableInput! - ): SSOProviderDisablePayload - """ - Enable a SSO provider. - """ - ssoProviderEnable( - """ - Parameters for SSOProviderEnable - """ - input: SSOProviderEnableInput! - ): SSOProviderEnablePayload - """ - Change the settings for a SSO provider. - """ - ssoProviderUpdate( - """ - Parameters for SSOProviderUpdate - """ - input: SSOProviderUpdateInput! - ): SSOProviderUpdatePayload - """ - Create a team. - """ - teamCreate( - """ - Parameters for TeamCreate - """ - input: TeamCreateInput! - ): TeamCreatePayload - """ - Delete a team. - """ - teamDelete( - """ - Parameters for TeamDelete - """ - input: TeamDeleteInput! - ): TeamDeletePayload - """ - Add a user to a team. - """ - teamMemberCreate( - """ - Parameters for TeamMemberCreate - """ - input: TeamMemberCreateInput! - ): TeamMemberCreatePayload - """ - Remove a user from a team. - """ - teamMemberDelete( - """ - Parameters for TeamMemberDelete - """ - input: TeamMemberDeleteInput! - ): TeamMemberDeletePayload - """ - Update a user's role in a team. - """ - teamMemberUpdate( - """ - Parameters for TeamMemberUpdate - """ - input: TeamMemberUpdateInput! - ): TeamMemberUpdatePayload - """ - Add a pipeline to a team. - """ - teamPipelineCreate( - """ - Parameters for TeamPipelineCreate - """ - input: TeamPipelineCreateInput! - ): TeamPipelineCreatePayload - """ - Remove a pipeline from a team. - """ - teamPipelineDelete( - """ - Parameters for TeamPipelineDelete - """ - input: TeamPipelineDeleteInput! - ): TeamPipelineDeletePayload - """ - Update a pipeline's access level within a team. - """ - teamPipelineUpdate( - """ - Parameters for TeamPipelineUpdate - """ - input: TeamPipelineUpdateInput! - ): TeamPipelineUpdatePayload - """ - Add a suite to a team. - """ - teamSuiteCreate( - """ - Parameters for TeamSuiteCreate - """ - input: TeamSuiteCreateInput! - ): TeamSuiteCreatePayload - """ - Remove a suite from a team. - """ - teamSuiteDelete( - """ - Parameters for TeamSuiteDelete - """ - input: TeamSuiteDeleteInput! - ): TeamSuiteDeletePayload - """ - Update a suite's access level within a team. - """ - teamSuiteUpdate( - """ - Parameters for TeamSuiteUpdate - """ - input: TeamSuiteUpdateInput! - ): TeamSuiteUpdatePayload - """ - Change the settings for a team. - """ - teamUpdate( - """ - Parameters for TeamUpdate - """ - input: TeamUpdateInput! - ): TeamUpdatePayload - """ - Activate a previously-generated TOTP configuration, and its Recovery Codes. - - Once activated, both this TOTP configuration, and the associated Recovery Codes will become active for the user. - Any previous TOTP configuration or Recovery Codes will no longer be usable. - - This mutation is private, requires an escalated session, and cannot be accessed via the public GraphQL API. - """ - totpActivate( - """ - Parameters for TOTPActivate - """ - input: TOTPActivateInput! - ): TOTPActivatePayload - """ - Create a new TOTP configuration for the current user. - - This will produce a TOTP configuration with an associated set of Recovery Codes. The Recovery Codes must be presented to the user prior to the TOTP's activation with `totpActivate`. - Neither TOTP configuration nor Recovery Codes will be usable until they have been activated. - - This mutation is private, requires an escalated session, and cannot be accessed via the public GraphQL API. - """ - totpCreate( - """ - Parameters for TOTPCreate - """ - input: TOTPCreateInput! - ): TOTPCreatePayload - """ - Delete a TOTP configuration. - - If a TOTP configuration was active, it will no longer be used for logging on to the user's account. - Any Recovery Codes associated with the TOTP configuration will also no longer be usable. - - This mutation is private, requires an escalated session, and cannot be accessed via the public GraphQL API. - """ - totpDelete( - """ - Parameters for TOTPDelete - """ - input: TOTPDeleteInput! - ): TOTPDeletePayload - """ - Generate a new set of Recovery Codes for a given TOTP. - - The new Recovery Codes will immediately replace any existing recovery codes. - - This mutation is private, requires an escalated session, and cannot be accessed via the public GraphQL API. - """ - totpRecoveryCodesRegenerate( - """ - Parameters for TOTPRecoveryCodesRegenerate - """ - input: TOTPRecoveryCodesRegenerateInput! - ): TOTPRecoveryCodesRegeneratePayload -} - -""" -An object with an ID. -""" +"""Instruct an agent to stop accepting new build jobs and shut itself down.""" + agentStop( +"""Parameters for AgentStop""" + input: AgentStopInput! + ): AgentStopPayload +"""Create a new agent registration token.""" + agentTokenCreate( +"""Parameters for AgentTokenCreate""" + input: AgentTokenCreateInput! + ): AgentTokenCreatePayload +"""Revoke an agent registration token.""" + agentTokenRevoke( +"""Parameters for AgentTokenRevoke""" + input: AgentTokenRevokeInput! + ): AgentTokenRevokePayload +"""Authorize an API Access Token Code generated by an API Application. Please note this mutation is private and cannot be executed externally.""" + apiAccessTokenCodeAuthorize( +"""Parameters for APIAccessTokenCodeAuthorizeMutation""" + input: APIAccessTokenCodeAuthorizeMutationInput! + ): APIAccessTokenCodeAuthorizeMutationPayload +"""Annotate a build with information to appear on the build page.""" + buildAnnotate( +"""Parameters for BuildAnnotate""" + input: BuildAnnotateInput! + ): BuildAnnotatePayload +"""Cancel a build.""" + buildCancel( +"""Parameters for BuildCancel""" + input: BuildCancelInput! + ): BuildCancelPayload +"""Create a build.""" + buildCreate( +"""Parameters for BuildCreate""" + input: BuildCreateInput! + ): BuildCreatePayload +"""Rebuild a build.""" + buildRebuild( +"""Parameters for BuildRebuild""" + input: BuildRebuildInput! + ): BuildRebuildPayload +"""Create a new cluster agent token""" + clusterAgentTokenCreate( +"""Parameters for ClusterAgentTokenCreate""" + input: ClusterAgentTokenCreateInput! + ): ClusterAgentTokenCreatePayload +"""Revokes a cluster agent token""" + clusterAgentTokenRevoke( +"""Parameters for ClusterAgentTokenRevoke""" + input: ClusterAgentTokenRevokeInput! + ): ClusterAgentTokenRevokePayload +"""Updates a cluster agent token""" + clusterAgentTokenUpdate( +"""Parameters for ClusterAgentTokenUpdate""" + input: ClusterAgentTokenUpdateInput! + ): ClusterAgentTokenUpdatePayload +"""Create a cluster.""" + clusterCreate( +"""Parameters for ClusterCreate""" + input: ClusterCreateInput! + ): ClusterCreatePayload +"""Delete a cluster.""" + clusterDelete( +"""Parameters for ClusterDelete""" + input: ClusterDeleteInput! + ): ClusterDeletePayload +"""Create a cluster queue.""" + clusterQueueCreate( +"""Parameters for ClusterQueueCreate""" + input: ClusterQueueCreateInput! + ): ClusterQueueCreatePayload +"""Delete a cluster queue.""" + clusterQueueDelete( +"""Parameters for ClusterQueueDelete""" + input: ClusterQueueDeleteInput! + ): ClusterQueueDeletePayload +"""This will prevent dispatch of jobs to agents on this queue. You can add an optional note describing the reason for pausing.""" + clusterQueuePauseDispatch( +"""Parameters for ClusterQueuePauseDispatch""" + input: ClusterQueuePauseDispatchInput! + ): ClusterQueuePauseDispatchPayload +"""This will resume dispatch of jobs on this queue.""" + clusterQueueResumeDispatch( +"""Parameters for ClusterQueueResumeDispatch""" + input: ClusterQueueResumeDispatchInput! + ): ClusterQueueResumeDispatchPayload +"""Updates a cluster queue.""" + clusterQueueUpdate( +"""Parameters for ClusterQueueUpdate""" + input: ClusterQueueUpdateInput! + ): ClusterQueueUpdatePayload +"""Updates a cluster.""" + clusterUpdate( +"""Parameters for ClusterUpdate""" + input: ClusterUpdateInput! + ): ClusterUpdatePayload +"""Add a new email address for the current user""" + emailCreate( +"""Parameters for EmailCreate""" + input: EmailCreateInput! + ): EmailCreatePayload +"""Resend a verification email.""" + emailResendVerification( +"""Parameters for EmailResendVerification""" + input: EmailResendVerificationInput! + ): EmailResendVerificationPayload +"""Create a GraphQL snippet.""" + graphQLSnippetCreate( +"""Parameters for GraphQLSnippetCreate""" + input: GraphQLSnippetCreateInput! + ): GraphQLSnippetCreatePayload +"""Unblocks a build's "Block pipeline" job.""" + jobTypeBlockUnblock( +"""Parameters for JobTypeBlockUnblock""" + input: JobTypeBlockUnblockInput! + ): JobTypeBlockUnblockPayload +"""Cancel a job.""" + jobTypeCommandCancel( +"""Parameters for JobTypeCommandCancel""" + input: JobTypeCommandCancelInput! + ): JobTypeCommandCancelPayload +"""Retry a job.""" + jobTypeCommandRetry( +"""Parameters for JobTypeCommandRetry""" + input: JobTypeCommandRetryInput! + ): JobTypeCommandRetryPayload +"""Dismisses a notice from the Buildkite UI. This mutation is idempotent so if you dismiss the same notice multiple times, it will return the original `dismissedAt` time""" + noticeDismiss( +"""Parameters for NoticeDismiss""" + input: NoticeDismissInput! + ): NoticeDismissPayload +"""Revokes access to an organization for a user's API access token. The organization can not be re-added to the same token, however the user can create a new token and add the organization to that token.""" + organizationApiAccessTokenRevoke( +"""Parameters for OrganizationAPIAccessTokenRevokeMutation""" + input: OrganizationAPIAccessTokenRevokeMutationInput! + ): OrganizationAPIAccessTokenRevokeMutationPayload +"""Sets an allowlist of IP addresses for API access to an organization. Please note that this is a beta feature and is not yet available to all organizations. """ + organizationApiIpAllowlistUpdate( +"""Parameters for OrganizationAPIIPAllowlistUpdateMutation""" + input: OrganizationAPIIPAllowlistUpdateMutationInput! + ): OrganizationAPIIPAllowlistUpdateMutationPayload +"""Send email invitations to this organization.""" + organizationInvitationCreate( +"""Parameters for OrganizationInvitationCreate""" + input: OrganizationInvitationCreateInput! + ): OrganizationInvitationCreatePayload +"""Resend an organization invitation email.""" + organizationInvitationResend( +"""Parameters for OrganizationInvitationResend""" + input: OrganizationInvitationResendInput! + ): OrganizationInvitationResendPayload +"""Revoke an invitation to an organization so that it can no longer be accepted.""" + organizationInvitationRevoke( +"""Parameters for OrganizationInvitationRevoke""" + input: OrganizationInvitationRevokeInput! + ): OrganizationInvitationRevokePayload +"""Remove a user from an organization.""" + organizationMemberDelete( +"""Parameters for OrganizationMemberDelete""" + input: OrganizationMemberDeleteInput! + ): OrganizationMemberDeletePayload +"""Change a user's role within an organization.""" + organizationMemberUpdate( +"""Parameters for OrganizationMemberUpdate""" + input: OrganizationMemberUpdateInput! + ): OrganizationMemberUpdatePayload +"""Archive a pipeline.""" + pipelineArchive( +"""Parameters for PipelineArchive""" + input: PipelineArchiveInput! + ): PipelineArchivePayload +"""Create a pipeline.""" + pipelineCreate( +"""Parameters for PipelineCreate""" + input: PipelineCreateInput! + ): PipelineCreatePayload +"""Create SCM webhooks for a pipeline.""" + pipelineCreateWebhook( +"""Parameters for PipelineCreateWebhook""" + input: PipelineCreateWebhookInput! + ): PipelineCreateWebhookPayload +"""Delete a pipeline.""" + pipelineDelete( +"""Parameters for PipelineDelete""" + input: PipelineDeleteInput! + ): PipelineDeletePayload +"""Favorite a pipeline.""" + pipelineFavorite( +"""Parameters for PipelineFavorite""" + input: PipelineFavoriteInput! + ): PipelineFavoritePayload +"""Rotate a pipeline's webhook URL. + +Note that the old webhook URL will stop working immediately and so must be updated quickly to avoid interruption. +""" + pipelineRotateWebhookURL( +"""Parameters for PipelineRotateWebhookURL""" + input: PipelineRotateWebhookURLInput! + ): PipelineRotateWebhookURLPayload +"""Create a scheduled build on pipeline.""" + pipelineScheduleCreate( +"""Parameters for PipelineScheduleCreate""" + input: PipelineScheduleCreateInput! + ): PipelineScheduleCreatePayload +"""Delete a scheduled build on pipeline.""" + pipelineScheduleDelete( +"""Parameters for PipelineScheduleDelete""" + input: PipelineScheduleDeleteInput! + ): PipelineScheduleDeletePayload +"""Update a scheduled build on pipeline.""" + pipelineScheduleUpdate( +"""Parameters for PipelineScheduleUpdate""" + input: PipelineScheduleUpdateInput! + ): PipelineScheduleUpdatePayload +"""Unarchive a pipeline.""" + pipelineUnarchive( +"""Parameters for PipelineUnarchive""" + input: PipelineUnarchiveInput! + ): PipelineUnarchivePayload +"""Change the settings for a pipeline.""" + pipelineUpdate( +"""Parameters for PipelineUpdate""" + input: PipelineUpdateInput! + ): PipelineUpdatePayload +"""Create a SSO provider.""" + ssoProviderCreate( +"""Parameters for SSOProviderCreate""" + input: SSOProviderCreateInput! + ): SSOProviderCreatePayload +"""Delete a SSO provider.""" + ssoProviderDelete( +"""Parameters for SSOProviderDelete""" + input: SSOProviderDeleteInput! + ): SSOProviderDeletePayload +"""Disable a SSO provider.""" + ssoProviderDisable( +"""Parameters for SSOProviderDisable""" + input: SSOProviderDisableInput! + ): SSOProviderDisablePayload +"""Enable a SSO provider.""" + ssoProviderEnable( +"""Parameters for SSOProviderEnable""" + input: SSOProviderEnableInput! + ): SSOProviderEnablePayload +"""Change the settings for a SSO provider.""" + ssoProviderUpdate( +"""Parameters for SSOProviderUpdate""" + input: SSOProviderUpdateInput! + ): SSOProviderUpdatePayload +"""Create a team.""" + teamCreate( +"""Parameters for TeamCreate""" + input: TeamCreateInput! + ): TeamCreatePayload +"""Delete a team.""" + teamDelete( +"""Parameters for TeamDelete""" + input: TeamDeleteInput! + ): TeamDeletePayload +"""Add a user to a team.""" + teamMemberCreate( +"""Parameters for TeamMemberCreate""" + input: TeamMemberCreateInput! + ): TeamMemberCreatePayload +"""Remove a user from a team.""" + teamMemberDelete( +"""Parameters for TeamMemberDelete""" + input: TeamMemberDeleteInput! + ): TeamMemberDeletePayload +"""Update a user's role in a team.""" + teamMemberUpdate( +"""Parameters for TeamMemberUpdate""" + input: TeamMemberUpdateInput! + ): TeamMemberUpdatePayload +"""Add a pipeline to a team.""" + teamPipelineCreate( +"""Parameters for TeamPipelineCreate""" + input: TeamPipelineCreateInput! + ): TeamPipelineCreatePayload +"""Remove a pipeline from a team.""" + teamPipelineDelete( +"""Parameters for TeamPipelineDelete""" + input: TeamPipelineDeleteInput! + ): TeamPipelineDeletePayload +"""Update a pipeline's access level within a team.""" + teamPipelineUpdate( +"""Parameters for TeamPipelineUpdate""" + input: TeamPipelineUpdateInput! + ): TeamPipelineUpdatePayload +"""Add a suite to a team.""" + teamSuiteCreate( +"""Parameters for TeamSuiteCreate""" + input: TeamSuiteCreateInput! + ): TeamSuiteCreatePayload +"""Remove a suite from a team.""" + teamSuiteDelete( +"""Parameters for TeamSuiteDelete""" + input: TeamSuiteDeleteInput! + ): TeamSuiteDeletePayload +"""Update a suite's access level within a team.""" + teamSuiteUpdate( +"""Parameters for TeamSuiteUpdate""" + input: TeamSuiteUpdateInput! + ): TeamSuiteUpdatePayload +"""Change the settings for a team.""" + teamUpdate( +"""Parameters for TeamUpdate""" + input: TeamUpdateInput! + ): TeamUpdatePayload +"""Activate a previously-generated TOTP configuration, and its Recovery Codes. + +Once activated, both this TOTP configuration, and the associated Recovery Codes will become active for the user. +Any previous TOTP configuration or Recovery Codes will no longer be usable. + +This mutation is private, requires an escalated session, and cannot be accessed via the public GraphQL API. +""" + totpActivate( +"""Parameters for TOTPActivate""" + input: TOTPActivateInput! + ): TOTPActivatePayload +"""Create a new TOTP configuration for the current user. + +This will produce a TOTP configuration with an associated set of Recovery Codes. The Recovery Codes must be presented to the user prior to the TOTP's activation with `totpActivate`. +Neither TOTP configuration nor Recovery Codes will be usable until they have been activated. + +This mutation is private, requires an escalated session, and cannot be accessed via the public GraphQL API. +""" + totpCreate( +"""Parameters for TOTPCreate""" + input: TOTPCreateInput! + ): TOTPCreatePayload +"""Delete a TOTP configuration. + +If a TOTP configuration was active, it will no longer be used for logging on to the user's account. +Any Recovery Codes associated with the TOTP configuration will also no longer be usable. + +This mutation is private, requires an escalated session, and cannot be accessed via the public GraphQL API. +""" + totpDelete( +"""Parameters for TOTPDelete""" + input: TOTPDeleteInput! + ): TOTPDeletePayload +"""Generate a new set of Recovery Codes for a given TOTP. + +The new Recovery Codes will immediately replace any existing recovery codes. + +This mutation is private, requires an escalated session, and cannot be accessed via the public GraphQL API. +""" + totpRecoveryCodesRegenerate( +"""Parameters for TOTPRecoveryCodesRegenerate""" + input: TOTPRecoveryCodesRegenerateInput! + ): TOTPRecoveryCodesRegeneratePayload +} + +"""An object with an ID.""" interface Node { - """ - An object with an ID. - """ - id: ID! +"""An object with an ID.""" + id: ID! } -""" -A notice or notice that a user sees in the Buildkite UI -""" +"""A notice or notice that a user sees in the Buildkite UI""" type Notice { - """ - The time when this notice was dismissed from the UI - """ - dismissedAt: DateTime - id: ID! - """ - The namespace of this notice - """ - namespace: NoticeNamespaces! - """ - The scope within the namespace - """ - scope: String! +"""The time when this notice was dismissed from the UI""" + dismissedAt: DateTime + id: ID! +"""The namespace of this notice""" + namespace: NoticeNamespaces! +"""The scope within the namespace""" + scope: String! } -""" -Autogenerated input type of NoticeDismiss -""" +"""Autogenerated input type of NoticeDismiss""" input NoticeDismissInput { - """ - Autogenerated input type of NoticeDismiss - """ - clientMutationId: String - """ - Autogenerated input type of NoticeDismiss - """ - id: ID! +"""Autogenerated input type of NoticeDismiss""" + clientMutationId: String +"""Autogenerated input type of NoticeDismiss""" + id: ID! } -""" -Autogenerated return type of NoticeDismiss. -""" +"""Autogenerated return type of NoticeDismiss.""" type NoticeDismissPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - notice: Notice +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + notice: Notice } -""" -All the possible namespaces for a notice -""" +"""All the possible namespaces for a notice""" enum NoticeNamespaces { - """ - A change to an existing feature - """ - CHANGE - """ - The user has had an email suggested to them - """ - EMAIL_SUGGESTION - """ - A new feature was added - """ - FEATURE - """ - An event announcement - """ - EVENT +"""A change to an existing feature""" + CHANGE +"""The user has had an email suggested to them""" + EMAIL_SUGGESTION +"""A new feature was added""" + FEATURE +"""An event announcement""" + EVENT } interface NotificationService { - description: String! - id: ID! - name: String! + description: String! + id: ID! + name: String! } -""" -Deliver notifications to Slack -""" -type NotificationServiceSlack implements Node & NotificationService { - """ - The description of this service - """ - description: String! - id: ID! - """ - The name of the service provider - """ - name: String! +"""Deliver notifications to Slack""" +type NotificationServiceSlack implements Node & NotificationService{ +"""The description of this service""" + description: String! + id: ID! +"""The name of the service provider""" + name: String! } -""" -Deliver notifications to a custom URL -""" -type NotificationServiceWebhook implements NotificationService { - """ - The description of this service - """ - description: String! - id: ID! - """ - The name of the service provider - """ - name: String! +"""Deliver notifications to a custom URL""" +type NotificationServiceWebhook implements NotificationService{ +"""The description of this service""" + description: String! + id: ID! +"""The name of the service provider""" + name: String! } -""" -A operating system that an agent can run on -""" +"""A operating system that an agent can run on""" type OperatingSystem { - """ - The name of the operating system - """ - name: String! -} - -""" -An organization -""" -type Organization implements Node { - """ - Returns agent access tokens for an Organization. By default returns all tokens, whether revoked or non-revoked. - """ - agentTokens( - first: Int - last: Int - """ - Filter tokens by whether they are revoked or not - """ - revoked: Boolean - ): AgentTokenConnection - agents( - first: Int - after: String - last: Int - before: String - """ - Search agents for the given query terms case insensitively across name and meta data - """ - search: String - """ - Filter agents to those only having the matching meta data - """ - metaData: [String!] - """ - Filter agents by membership of a given cluster - """ - cluster: ID - """ - Filter agents to those within a given cluster queue - """ - clusterQueue: [ID!] - """ - Pass `false` to exclude agents that belong to a cluster queue - """ - clustered: Boolean - """ - Filter agents by whether they are running a job or not - """ - isRunningJob: Boolean - ): AgentConnection - """ - A space-separated allowlist of IP addresses that can access the organization via the GraphQL or REST API - """ - allowedApiIpAddresses: String - """ - Returns user API access tokens that can access this organization - """ - apiAccessTokens( - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the last _n_ elements from the list. - """ - last: Int - ): OrganizationAPIAccessTokenConnection! - auditEvents( - first: Int - after: String - last: Int - before: String - """ - Filter events which occurred from the given date and time - """ - occurredAtFrom: DateTime - """ - Filter events which occurred until the given date and time - """ - occurredAtTo: DateTime - """ - Filter the events by type - """ - type: [AuditEventType!] - """ - Filter the events by the type of actor who initiated them - """ - actorType: [AuditActorType!] - """ - Filter the events by the IDs of the actors who initiated them - """ - actor: [ID!] - """ - Filter the events by the type of subject they relate to - """ - subjectType: [AuditSubjectType!] - """ - Filter the events by the IDs of the subject they relate to - """ - subject: [ID!] - """ - Order the events - """ - order: OrganizationAuditEventOrders - """ - Filter the events by the UUIDs of the subject they relate to - """ - subjectUUID: [ID!] - ): OrganizationAuditEventConnection - """ - Return cluster in the Organization by UUID - """ - cluster(id: ID!): Cluster - """ - Returns clusters for an Organization - """ - clusters( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - """ - Order the clusters - """ - order: ClusterOrder - ): ClusterConnection - """ - The URL to an icon representing this organization - """ - iconUrl: String - id: ID! - invitations( - first: Int - after: String - last: Int - before: String - state: [OrganizationInvitationStates!] - """ - Order the invitations - """ - order: OrganizationInvitationOrders - ): OrganizationInvitationConnection - """ - Whether teams is enabled for this organization - """ - isTeamsEnabled: Boolean! - jobs( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - type: [JobTypes!] - state: [JobStates!] - priority: JobPrioritySearch - agentQueryRules: [String!] - concurrency: JobConcurrencySearch - """ - Whether or not the command job passed. Passing `false` will return all failed jobs (including "soft failed" jobs) - """ - passed: Boolean - """ - Filtering jobs based on related step information - """ - step: JobStepSearch - """ - Order the jobs - """ - order: JobOrder - """ - Filter jobs by membership of a given cluster - """ - cluster: ID - """ - Filter jobs to those within a given cluster queue - """ - clusterQueue: [ID!] - """ - Pass `false` to exclude jobs that belong to a cluster queue - """ - clustered: Boolean - ): JobConnection - """ - Returns users within the organization - """ - members( - first: Int - after: String - last: Int - before: String - """ - Search members named like the given query case insensitively - """ - search: String - """ - The primary email of the team member - """ - email: String - """ - Filter the members by team - """ - team: TeamSelector - """ - Search members by their role - """ - role: [OrganizationMemberRole!] - security: OrganizationMemberSecurityInput - sso: OrganizationMemberSSOInput - """ - Order the members - """ - order: OrganizationMemberOrder - ): OrganizationMemberConnection - """ - The name of the organization - """ - name: String! - permissions: OrganizationPermissions! - """ - Return all the pipelines the current user has access to for this organization - """ - pipelines( - first: Int - after: String - last: Int - before: String - """ - Search pipelines named like the given query case insensitively - """ - search: String - repository: PipelineRepositoryInput - """ - Filter pipelines by membership of a given cluster - """ - cluster: ID - """ - Pass `false` to exclude pipelines that belong to a cluster - """ - clustered: Boolean - """ - Filter pipelines based on whether or not they've been archived. If not provided, all pipelines are returned regardless of archived state. - """ - archived: Boolean - """ - Filter the pipelines by team - """ - team: TeamSelector - """ - Only return favorited pipelines - """ - favorite: Boolean - """ - Order the pipelines - """ - order: PipelineOrders - """ - Filter pipelines with those that have particular tags - """ - tags: [String!] - createdAtFrom: DateTime - createdAtTo: DateTime - ): PipelineConnection - """ - Whether this organization is visible to everyone, including people outside it - """ - public: Boolean! - """ - The slug used to represent the organization in URLs - """ - slug: String! - """ - The single sign-on configuration of this organization - """ - sso: OrganizationSSO - """ - Single sign on providers created for an organization - """ - ssoProviders( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - ): SSOProviderConnection - """ - Return all the suite the current user has access to for this organization - """ - suites( - first: Int - after: String - last: Int - before: String - """ - Search suites named like the given query case insensitively - """ - search: String - """ - Filter the suites by team - """ - team: TeamSelector - """ - Order the suites - """ - order: SuiteOrders - createdAtFrom: DateTime - createdAtTo: DateTime - ): SuiteConnection - """ - Returns teams within the organization that the viewer can see - """ - teams( - first: Int - after: String - last: Int - before: String - """ - Search teams - """ - search: String - """ - Filter teams by pipeline - """ - pipeline: PipelineSelector - """ - Filter teams by user membership - """ - user: UserSelector - """ - Search teams by their privacy - """ - privacy: [TeamPrivacy!] - """ - Order the teams - """ - order: TeamOrder - ): TeamConnection - """ - Returns the resource usage data for this organization. Please note that this feature is not yet available to all organizations - """ - usage( - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Filter aggregations performed from this date - """ - aggregatedOnFrom: ISO8601Date - """ - Filter aggregations performed until this date - """ - aggregatedOnTo: ISO8601Date - """ - Filter results by resource type - """ - resource: [ResourceUsageType!] - """ - Filter results by the associated Pipeline ID - """ - pipelineIds: [ID!] - """ - Filter results by the associated Suite ID - """ - suiteIds: [ID!] - ): UsageUnionConnection! - """ - The public UUID for this organization - """ - uuid: String! -} - -""" -Information on user API Access Tokens which can access the Organization. Excludes the token attribute -""" +"""The name of the operating system""" + name: String! +} + +"""An organization""" +type Organization implements Node{ +"""Returns agent access tokens for an Organization. By default returns all tokens, whether revoked or non-revoked.""" + agentTokens( + first: Int + last: Int +"""Filter tokens by whether they are revoked or not""" + revoked: Boolean + ): AgentTokenConnection + agents( + first: Int + after: String + last: Int + before: String +"""Search agents for the given query terms case insensitively across name and meta data""" + search: String +"""Filter agents to those only having the matching meta data""" + metaData: [String!] +"""Filter agents by membership of a given cluster""" + cluster: ID +"""Filter agents to those within a given cluster queue""" + clusterQueue: [ID!] +"""Pass `false` to exclude agents that belong to a cluster queue""" + clustered: Boolean +"""Filter agents by whether they are running a job or not""" + isRunningJob: Boolean + ): AgentConnection +"""A space-separated allowlist of IP addresses that can access the organization via the GraphQL or REST API""" + allowedApiIpAddresses: String +"""Returns user API access tokens that can access this organization""" + apiAccessTokens( +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the elements in the list that come before the specified cursor.""" + before: String +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the last _n_ elements from the list.""" + last: Int + ): OrganizationAPIAccessTokenConnection! + auditEvents( + first: Int + after: String + last: Int + before: String +"""Filter events which occurred from the given date and time""" + occurredAtFrom: DateTime +"""Filter events which occurred until the given date and time""" + occurredAtTo: DateTime +"""Filter the events by type""" + type: [AuditEventType!] +"""Filter the events by the type of actor who initiated them""" + actorType: [AuditActorType!] +"""Filter the events by the IDs of the actors who initiated them""" + actor: [ID!] +"""Filter the events by the type of subject they relate to""" + subjectType: [AuditSubjectType!] +"""Filter the events by the IDs of the subject they relate to""" + subject: [ID!] +"""Order the events""" + order: OrganizationAuditEventOrders +"""Filter the events by the UUIDs of the subject they relate to""" + subjectUUID: [ID!] + ): OrganizationAuditEventConnection +"""Return cluster in the Organization by UUID""" + cluster( + id: ID! + ): Cluster +"""Returns clusters for an Organization""" + clusters( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String +"""Order the clusters""" + order: ClusterOrder + ): ClusterConnection +"""The URL to an icon representing this organization""" + iconUrl: String + id: ID! + invitations( + first: Int + after: String + last: Int + before: String + state: [OrganizationInvitationStates!] +"""Order the invitations""" + order: OrganizationInvitationOrders + ): OrganizationInvitationConnection +"""Whether teams is enabled for this organization""" + isTeamsEnabled: Boolean! + jobs( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + type: [JobTypes!] + state: [JobStates!] + priority: JobPrioritySearch + agentQueryRules: [String!] + concurrency: JobConcurrencySearch +"""Whether or not the command job passed. Passing `false` will return all failed jobs (including "soft failed" jobs)""" + passed: Boolean +"""Filtering jobs based on related step information""" + step: JobStepSearch +"""Order the jobs""" + order: JobOrder +"""Filter jobs by membership of a given cluster""" + cluster: ID +"""Filter jobs to those within a given cluster queue""" + clusterQueue: [ID!] +"""Pass `false` to exclude jobs that belong to a cluster queue""" + clustered: Boolean + ): JobConnection +"""Returns users within the organization""" + members( + first: Int + after: String + last: Int + before: String +"""Search members named like the given query case insensitively""" + search: String +"""The primary email of the team member""" + email: String +"""Filter the members by team""" + team: TeamSelector +"""Search members by their role""" + role: [OrganizationMemberRole!] + security: OrganizationMemberSecurityInput + sso: OrganizationMemberSSOInput +"""Order the members""" + order: OrganizationMemberOrder + ): OrganizationMemberConnection +"""The name of the organization""" + name: String! + permissions: OrganizationPermissions! +"""Return all the pipelines the current user has access to for this organization""" + pipelines( + first: Int + after: String + last: Int + before: String +"""Search pipelines named like the given query case insensitively""" + search: String + repository: PipelineRepositoryInput +"""Filter pipelines by membership of a given cluster""" + cluster: ID +"""Pass `false` to exclude pipelines that belong to a cluster""" + clustered: Boolean +"""Filter pipelines based on whether or not they've been archived. If not provided, all pipelines are returned regardless of archived state.""" + archived: Boolean +"""Filter the pipelines by team""" + team: TeamSelector +"""Only return favorited pipelines""" + favorite: Boolean +"""Order the pipelines""" + order: PipelineOrders +"""Filter pipelines with those that have particular tags""" + tags: [String!] + createdAtFrom: DateTime + createdAtTo: DateTime + ): PipelineConnection +"""Whether this organization is visible to everyone, including people outside it""" + public: Boolean! +"""The slug used to represent the organization in URLs""" + slug: String! +"""The single sign-on configuration of this organization""" + sso: OrganizationSSO +"""Single sign on providers created for an organization""" + ssoProviders( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + ): SSOProviderConnection +"""Return all the suite the current user has access to for this organization""" + suites( + first: Int + after: String + last: Int + before: String +"""Search suites named like the given query case insensitively""" + search: String +"""Filter the suites by team""" + team: TeamSelector +"""Order the suites""" + order: SuiteOrders + createdAtFrom: DateTime + createdAtTo: DateTime + ): SuiteConnection +"""Returns teams within the organization that the viewer can see""" + teams( + first: Int + after: String + last: Int + before: String +"""Search teams""" + search: String +"""Filter teams by pipeline""" + pipeline: PipelineSelector +"""Filter teams by user membership""" + user: UserSelector +"""Search teams by their privacy""" + privacy: [TeamPrivacy!] +"""Order the teams""" + order: TeamOrder + ): TeamConnection +"""Returns the resource usage data for this organization. Please note that this feature is not yet available to all organizations""" + usage( +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the elements in the list that come before the specified cursor.""" + before: String +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the last _n_ elements from the list.""" + last: Int +"""Filter aggregations performed from this date""" + aggregatedOnFrom: ISO8601Date +"""Filter aggregations performed until this date""" + aggregatedOnTo: ISO8601Date +"""Filter results by resource type""" + resource: [ResourceUsageType!] +"""Filter results by the associated Pipeline ID""" + pipelineIds: [ID!] +"""Filter results by the associated Suite ID""" + suiteIds: [ID!] + ): UsageUnionConnection! +"""The public UUID for this organization""" + uuid: String! +} + +"""Information on user API Access Tokens which can access the Organization. Excludes the token attribute""" type OrganizationAPIAccessToken { - createdAt: DateTime! - """ - A description of the token - """ - description: String - id: ID! - """ - The IP address of the last request to the Buildkite API - """ - ipAddress: String - """ - The last time the token was used to access the Buildkite API - """ - lastAccessedAt: DateTime - """ - The user associated with this token - """ - owner: User - """ - The organization scopes that the user's token has access to - """ - scopes: [APIAccessTokenScopes!]! - """ - The public UUID for the API Access Token - """ - uuid: ID! -} - -""" -The connection type for OrganizationAPIAccessToken. -""" + createdAt: DateTime! +"""A description of the token""" + description: String + id: ID! +"""The IP address of the last request to the Buildkite API""" + ipAddress: String +"""The last time the token was used to access the Buildkite API""" + lastAccessedAt: DateTime +"""The user associated with this token""" + owner: User +"""The organization scopes that the user's token has access to""" + scopes: [APIAccessTokenScopes!]! +"""The public UUID for the API Access Token""" + uuid: ID! +} + +"""The connection type for OrganizationAPIAccessToken.""" type OrganizationAPIAccessTokenConnection { - """ - A list of edges. - """ - edges: [OrganizationAPIAccessTokenEdge] - """ - A list of nodes. - """ - nodes: [OrganizationAPIAccessToken] - """ - Information to aid in pagination. - """ - pageInfo: PageInfo! +"""A list of edges.""" + edges: [OrganizationAPIAccessTokenEdge] +"""A list of nodes.""" + nodes: [OrganizationAPIAccessToken] +"""Information to aid in pagination.""" + pageInfo: PageInfo! } -""" -An edge in a connection. -""" +"""An edge in a connection.""" type OrganizationAPIAccessTokenEdge { - """ - A cursor for use in pagination. - """ - cursor: String! - """ - The item at the end of the edge. - """ - node: OrganizationAPIAccessToken +"""A cursor for use in pagination.""" + cursor: String! +"""The item at the end of the edge.""" + node: OrganizationAPIAccessToken } -""" -Autogenerated input type of OrganizationAPIAccessTokenRevokeMutation -""" +"""Autogenerated input type of OrganizationAPIAccessTokenRevokeMutation""" input OrganizationAPIAccessTokenRevokeMutationInput { - """ - Autogenerated input type of OrganizationAPIAccessTokenRevokeMutation - """ - clientMutationId: String - """ - Autogenerated input type of OrganizationAPIAccessTokenRevokeMutation - """ - organizationId: ID! - """ - Autogenerated input type of OrganizationAPIAccessTokenRevokeMutation - """ - apiAccessTokenId: ID! +"""Autogenerated input type of OrganizationAPIAccessTokenRevokeMutation""" + clientMutationId: String +"""Autogenerated input type of OrganizationAPIAccessTokenRevokeMutation""" + organizationId: ID! +"""Autogenerated input type of OrganizationAPIAccessTokenRevokeMutation""" + apiAccessTokenId: ID! } -""" -Autogenerated return type of OrganizationAPIAccessTokenRevokeMutation. -""" +"""Autogenerated return type of OrganizationAPIAccessTokenRevokeMutation.""" type OrganizationAPIAccessTokenRevokeMutationPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - revokedApiAccessTokenId: ID! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + revokedApiAccessTokenId: ID! } -""" -Autogenerated input type of OrganizationAPIIPAllowlistUpdateMutation -""" +"""Autogenerated input type of OrganizationAPIIPAllowlistUpdateMutation""" input OrganizationAPIIPAllowlistUpdateMutationInput { - """ - Autogenerated input type of OrganizationAPIIPAllowlistUpdateMutation - """ - clientMutationId: String - """ - Autogenerated input type of OrganizationAPIIPAllowlistUpdateMutation - """ - organizationID: ID! - """ - Autogenerated input type of OrganizationAPIIPAllowlistUpdateMutation - """ - ipAddresses: String! +"""Autogenerated input type of OrganizationAPIIPAllowlistUpdateMutation""" + clientMutationId: String +"""Autogenerated input type of OrganizationAPIIPAllowlistUpdateMutation""" + organizationID: ID! +"""Autogenerated input type of OrganizationAPIIPAllowlistUpdateMutation""" + ipAddresses: String! } -""" -Autogenerated return type of OrganizationAPIIPAllowlistUpdateMutation. -""" +"""Autogenerated return type of OrganizationAPIIPAllowlistUpdateMutation.""" type OrganizationAPIIPAllowlistUpdateMutationPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - organization: Organization +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + organization: Organization } -type OrganizationAuditEventConnection implements Connection { - count: Int! - edges: [OrganizationAuditEventEdge] - pageInfo: PageInfo +type OrganizationAuditEventConnection implements Connection{ + count: Int! + edges: [OrganizationAuditEventEdge] + pageInfo: PageInfo } type OrganizationAuditEventEdge { - cursor: String! - node: AuditEvent + cursor: String! + node: AuditEvent } -""" -The different orders you can sort audit events by -""" +"""The different orders you can sort audit events by""" enum OrganizationAuditEventOrders { - """ - Order by the most recently occurring events first - """ - RECENTLY_OCCURRED +"""Order by the most recently occurring events first""" + RECENTLY_OCCURRED } -type OrganizationConnection implements Connection { - count: Int! - edges: [OrganizationEdge] - pageInfo: PageInfo +type OrganizationConnection implements Connection{ + count: Int! + edges: [OrganizationEdge] + pageInfo: PageInfo } type OrganizationEdge { - cursor: String! - node: Organization -} - -""" -A pending invitation to a user to join this organization -""" -type OrganizationInvitation implements Node { - """ - The time when the invitation was accepted - """ - acceptedAt: DateTime - """ - The user that accepted this invite - """ - acceptedBy: User - """ - The time when the invitation was created - """ - createdAt: DateTime - """ - The user that added invited this email address - """ - createdBy: User - """ - The email address of this invitation - """ - email: String! - """ - The time when the invitation was automatically expired - """ - expiredAt: DateTime - id: ID! - organization: Organization - permissions: OrganizationInvitationPermissions! - """ - The time when this invitation was revoked - """ - revokedAt: DateTime - """ - The user that revoked this invitation - """ - revokedBy: User - """ - The role the user will have in the organization once they've accepted the invitation - """ - role: OrganizationMemberRole! - """ - The slug of the invitation that can be used to find an invitation in the query root - """ - slug: String! - sso: OrganizationInvitationSSOType! - """ - The current state of the invitation - """ - state: OrganizationInvitationStates! - """ - Teams that have been assigned to this invitation - """ - teams( - """ - Returns the first _n_ elements from the list. - """ - first: Int - ): OrganizationInvitationTeamAssignmentConnection - """ - The UUID of the invitation - """ - uuid: String! -} - -type OrganizationInvitationConnection implements Connection { - count: Int! - edges: [OrganizationInvitationEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of OrganizationInvitationCreate -""" + cursor: String! + node: Organization +} + +"""A pending invitation to a user to join this organization""" +type OrganizationInvitation implements Node{ +"""The time when the invitation was accepted""" + acceptedAt: DateTime +"""The user that accepted this invite""" + acceptedBy: User +"""The time when the invitation was created""" + createdAt: DateTime +"""The user that added invited this email address""" + createdBy: User +"""The email address of this invitation""" + email: String! +"""The time when the invitation was automatically expired""" + expiredAt: DateTime + id: ID! + organization: Organization + permissions: OrganizationInvitationPermissions! +"""The time when this invitation was revoked""" + revokedAt: DateTime +"""The user that revoked this invitation""" + revokedBy: User +"""The role the user will have in the organization once they've accepted the invitation""" + role: OrganizationMemberRole! +"""The slug of the invitation that can be used to find an invitation in the query root""" + slug: String! + sso: OrganizationInvitationSSOType! +"""The current state of the invitation""" + state: OrganizationInvitationStates! +"""Teams that have been assigned to this invitation""" + teams( +"""Returns the first _n_ elements from the list.""" + first: Int + ): OrganizationInvitationTeamAssignmentConnection +"""The UUID of the invitation""" + uuid: String! +} + +type OrganizationInvitationConnection implements Connection{ + count: Int! + edges: [OrganizationInvitationEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of OrganizationInvitationCreate""" input OrganizationInvitationCreateInput { - """ - Autogenerated input type of OrganizationInvitationCreate - """ - clientMutationId: String - """ - Autogenerated input type of OrganizationInvitationCreate - """ - organizationID: ID! - """ - Autogenerated input type of OrganizationInvitationCreate - """ - emails: [String!]! - """ - Autogenerated input type of OrganizationInvitationCreate - """ - role: OrganizationMemberRole - """ - Autogenerated input type of OrganizationInvitationCreate - """ - sso: OrganizationInvitationSSOInput - """ - Autogenerated input type of OrganizationInvitationCreate - """ - teams: [OrganizationInvitationTeamAssignmentInput!] -} - -""" -Autogenerated return type of OrganizationInvitationCreate. -""" +"""Autogenerated input type of OrganizationInvitationCreate""" + clientMutationId: String +"""Autogenerated input type of OrganizationInvitationCreate""" + organizationID: ID! +"""Autogenerated input type of OrganizationInvitationCreate""" + emails: [String!]! +"""Autogenerated input type of OrganizationInvitationCreate""" + role: OrganizationMemberRole +"""Autogenerated input type of OrganizationInvitationCreate""" + sso: OrganizationInvitationSSOInput +"""Autogenerated input type of OrganizationInvitationCreate""" + teams: [OrganizationInvitationTeamAssignmentInput!] +} + +"""Autogenerated return type of OrganizationInvitationCreate.""" type OrganizationInvitationCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - invitationEdges: [OrganizationInvitationEdge] - organization: Organization +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + invitationEdges: [OrganizationInvitationEdge] + organization: Organization } type OrganizationInvitationEdge { - cursor: String! - node: OrganizationInvitation + cursor: String! + node: OrganizationInvitation } -""" -The different orders you can sort organization invitations by -""" +"""The different orders you can sort organization invitations by""" enum OrganizationInvitationOrders { - """ - Order by email address alphabetically - """ - EMAIL - """ - Order by the most recently created invitations first - """ - RECENTLY_CREATED +"""Order by email address alphabetically""" + EMAIL +"""Order by the most recently created invitations first""" + RECENTLY_CREATED } -""" -Permissions information about what actions the current user can do against this invitation -""" +"""Permissions information about what actions the current user can do against this invitation""" type OrganizationInvitationPermissions { - """ - Whether the user can resend this invitation - """ - organizationInvitationResend: Permission - """ - Whether the user can revoke this invitation - """ - organizationInvitationRevoke: Permission +"""Whether the user can resend this invitation""" + organizationInvitationResend: Permission +"""Whether the user can revoke this invitation""" + organizationInvitationRevoke: Permission } -""" -Autogenerated input type of OrganizationInvitationResend -""" +"""Autogenerated input type of OrganizationInvitationResend""" input OrganizationInvitationResendInput { - """ - Autogenerated input type of OrganizationInvitationResend - """ - clientMutationId: String - """ - Autogenerated input type of OrganizationInvitationResend - """ - id: ID! +"""Autogenerated input type of OrganizationInvitationResend""" + clientMutationId: String +"""Autogenerated input type of OrganizationInvitationResend""" + id: ID! } -""" -Autogenerated return type of OrganizationInvitationResend. -""" +"""Autogenerated return type of OrganizationInvitationResend.""" type OrganizationInvitationResendPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - organizationInvitation: OrganizationInvitation! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + organizationInvitation: OrganizationInvitation! } -""" -Autogenerated input type of OrganizationInvitationRevoke -""" +"""Autogenerated input type of OrganizationInvitationRevoke""" input OrganizationInvitationRevokeInput { - """ - Autogenerated input type of OrganizationInvitationRevoke - """ - clientMutationId: String - """ - Autogenerated input type of OrganizationInvitationRevoke - """ - id: ID! +"""Autogenerated input type of OrganizationInvitationRevoke""" + clientMutationId: String +"""Autogenerated input type of OrganizationInvitationRevoke""" + id: ID! } -""" -Autogenerated return type of OrganizationInvitationRevoke. -""" +"""Autogenerated return type of OrganizationInvitationRevoke.""" type OrganizationInvitationRevokePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - organization: Organization! - organizationInvitation: OrganizationInvitation! - organizationInvitationEdge: OrganizationInvitationEdge! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + organization: Organization! + organizationInvitation: OrganizationInvitation! + organizationInvitationEdge: OrganizationInvitationEdge! } input OrganizationInvitationSSOInput { - mode: OrganizationMemberSSOModeEnum! + mode: OrganizationMemberSSOModeEnum! } -""" -Information about the SSO setup for this invited organization member -""" +"""Information about the SSO setup for this invited organization member""" type OrganizationInvitationSSOType { - """ - The SSO mode of the invited organization member - """ - mode: OrganizationMemberSSOModeEnum +"""The SSO mode of the invited organization member""" + mode: OrganizationMemberSSOModeEnum } -""" -All the possible states that an organization invitation can be -""" +"""All the possible states that an organization invitation can be""" enum OrganizationInvitationStates { - """ - The invitation is waiting for a user to accept it - """ - PENDING - """ - The invitation was accepted by the person it was sent to - """ - ACCEPTED - """ - The invitation wasn't accepted and the link has expired - """ - EXPIRED - """ - The invitation was revoked and can no longer be accepted - """ - REVOKED +"""The invitation is waiting for a user to accept it""" + PENDING +"""The invitation was accepted by the person it was sent to""" + ACCEPTED +"""The invitation wasn't accepted and the link has expired""" + EXPIRED +"""The invitation was revoked and can no longer be accepted""" + REVOKED } -""" -A team that has been assigned to an invitation -""" +"""A team that has been assigned to an invitation""" type OrganizationInvitationTeamAssignment { - id: ID! - """ - The role that the user will have once they've accepted the invite - """ - role: TeamMemberRole! - """ - The team that this assignment refers to - """ - team: Team! + id: ID! +"""The role that the user will have once they've accepted the invite""" + role: TeamMemberRole! +"""The team that this assignment refers to""" + team: Team! } -type OrganizationInvitationTeamAssignmentConnection implements Connection { - count: Int! - edges: [OrganizationInvitationTeamAssignmentEdge] - pageInfo: PageInfo +type OrganizationInvitationTeamAssignmentConnection implements Connection{ + count: Int! + edges: [OrganizationInvitationTeamAssignmentEdge] + pageInfo: PageInfo } type OrganizationInvitationTeamAssignmentEdge { - cursor: String! - node: OrganizationInvitationTeamAssignment + cursor: String! + node: OrganizationInvitationTeamAssignment } -""" -Used to assign teams to organization invitation in mutations -""" +"""Used to assign teams to organization invitation in mutations""" input OrganizationInvitationTeamAssignmentInput { - """ - Used to assign teams to organization invitation in mutations - """ - id: ID! - """ - Used to assign teams to organization invitation in mutations - """ - role: TeamMemberRole! -} - -""" -A member of an organization -""" -type OrganizationMember implements Node { - """ - Whether or not organizations are required to pay for this user - """ - complimentary: Boolean! - """ - The time when this user was added to the organization - """ - createdAt: DateTime! - """ - The user that added invited this user - """ - createdBy: User - id: ID! - organization: Organization! - permissions: OrganizationMemberPermissions! - """ - Pipelines the user has access to within the organization - """ - pipelines( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - """ - Search within the pipelines the user has access to - """ - search: String - """ - Order the pipelines returned - """ - order: PipelineOrders - ): OrganizationMemberPipelineConnection! - """ - The users role within the organization - """ - role: OrganizationMemberRole! - security: OrganizationMemberSecurity! - sso: OrganizationMemberSSO! - """ - Teams that this user is a part of within the organization - """ - teams( - first: Int - after: String - last: Int - before: String - """ - Order the members returned - """ - order: TeamMemberOrder - ): TeamMemberConnection! - user: User! - """ - The public UUID for this organization member - """ - uuid: String! -} - -type OrganizationMemberConnection implements Connection { - count: Int! - edges: [OrganizationMemberEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of OrganizationMemberDelete -""" +"""Used to assign teams to organization invitation in mutations""" + id: ID! +"""Used to assign teams to organization invitation in mutations""" + role: TeamMemberRole! +} + +"""A member of an organization""" +type OrganizationMember implements Node{ +"""Whether or not organizations are required to pay for this user""" + complimentary: Boolean! +"""The time when this user was added to the organization""" + createdAt: DateTime! +"""The user that added invited this user""" + createdBy: User + id: ID! + organization: Organization! + permissions: OrganizationMemberPermissions! +"""Pipelines the user has access to within the organization""" + pipelines( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String +"""Search within the pipelines the user has access to""" + search: String +"""Order the pipelines returned""" + order: PipelineOrders + ): OrganizationMemberPipelineConnection! +"""The users role within the organization""" + role: OrganizationMemberRole! + security: OrganizationMemberSecurity! + sso: OrganizationMemberSSO! +"""Teams that this user is a part of within the organization""" + teams( + first: Int + after: String + last: Int + before: String +"""Order the members returned""" + order: TeamMemberOrder + ): TeamMemberConnection! + user: User! +"""The public UUID for this organization member""" + uuid: String! +} + +type OrganizationMemberConnection implements Connection{ + count: Int! + edges: [OrganizationMemberEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of OrganizationMemberDelete""" input OrganizationMemberDeleteInput { - """ - Autogenerated input type of OrganizationMemberDelete - """ - clientMutationId: String - """ - Autogenerated input type of OrganizationMemberDelete - """ - id: ID! +"""Autogenerated input type of OrganizationMemberDelete""" + clientMutationId: String +"""Autogenerated input type of OrganizationMemberDelete""" + id: ID! } -""" -Autogenerated return type of OrganizationMemberDelete. -""" +"""Autogenerated return type of OrganizationMemberDelete.""" type OrganizationMemberDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedOrganizationMemberID: ID! - organization: Organization - user: User +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedOrganizationMemberID: ID! + organization: Organization + user: User } type OrganizationMemberEdge { - cursor: String! - node: OrganizationMember + cursor: String! + node: OrganizationMember } -""" -The different orders you can sort members by -""" +"""The different orders you can sort members by""" enum OrganizationMemberOrder { - """ - Order by name alphabetically - """ - NAME - """ - Order by the most recently created members first - """ - RECENTLY_CREATED - """ - Order by relevance when searching for members - """ - RELEVANCE +"""Order by name alphabetically""" + NAME +"""Order by the most recently created members first""" + RECENTLY_CREATED +"""Order by relevance when searching for members""" + RELEVANCE } -""" -Permissions information about what actions the current user can do against the organization membership record -""" +"""Permissions information about what actions the current user can do against the organization membership record""" type OrganizationMemberPermissions { - """ - Whether the user can delete the user from the organization - """ - organizationMemberDelete: Permission - """ - Whether the user can update the organization's members role information - """ - organizationMemberUpdate: Permission +"""Whether the user can delete the user from the organization""" + organizationMemberDelete: Permission +"""Whether the user can update the organization's members role information""" + organizationMemberUpdate: Permission } -""" -Represents the connection between a user an a pipeline within an organization -""" +"""Represents the connection between a user an a pipeline within an organization""" type OrganizationMemberPipeline { - """ - The pipeline the user has access to within the organization - """ - pipeline: Pipeline! +"""The pipeline the user has access to within the organization""" + pipeline: Pipeline! } -type OrganizationMemberPipelineConnection implements Connection { - count: Int! - edges: [OrganizationMemberPipelineEdge] - pageInfo: PageInfo +type OrganizationMemberPipelineConnection implements Connection{ + count: Int! + edges: [OrganizationMemberPipelineEdge] + pageInfo: PageInfo } type OrganizationMemberPipelineEdge { - cursor: String! - node: OrganizationMemberPipeline + cursor: String! + node: OrganizationMemberPipeline } -""" -The roles a user can be within an organization -""" +"""The roles a user can be within an organization""" enum OrganizationMemberRole { - """ - The user is a regular member of the organization - """ - MEMBER - """ - Has full access to the entire organization - """ - ADMIN +"""The user is a regular member of the organization""" + MEMBER +"""Has full access to the entire organization""" + ADMIN } -""" -Information about the SSO setup for this organization member -""" +"""Information about the SSO setup for this organization member""" type OrganizationMemberSSO { - """ - SSO authorizations provided by your organization that have been created for this user - """ - authorizations( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - """ - Filter authorizations by state - """ - state: [SSOAuthorizationState!] - ): SSOAuthorizationConnection - """ - The SSO mode of the organization member - """ - mode: OrganizationMemberSSOModeEnum +"""SSO authorizations provided by your organization that have been created for this user""" + authorizations( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String +"""Filter authorizations by state""" + state: [SSOAuthorizationState!] + ): SSOAuthorizationConnection +"""The SSO mode of the organization member""" + mode: OrganizationMemberSSOModeEnum } input OrganizationMemberSSOInput { - mode: OrganizationMemberSSOModeEnum! + mode: OrganizationMemberSSOModeEnum! } -""" -The SSO authorization modes you can use on a member -""" +"""The SSO authorization modes you can use on a member""" enum OrganizationMemberSSOModeEnum { - """ - The member must use SSO to access your organization - """ - REQUIRED - """ - The member can either use SSO or their email & password - """ - OPTIONAL +"""The member must use SSO to access your organization""" + REQUIRED +"""The member can either use SSO or their email & password""" + OPTIONAL } -""" -Information about what security settings the user has enabled in Buildkite -""" +"""Information about what security settings the user has enabled in Buildkite""" type OrganizationMemberSecurity { - """ - If the user has secured their Buildkite user account with a password - """ - passwordProtected: Boolean! - """ - If the user has enabled Two Factor Authentication - """ - twoFactorEnabled: Boolean! +"""If the user has secured their Buildkite user account with a password""" + passwordProtected: Boolean! +"""If the user has enabled Two Factor Authentication""" + twoFactorEnabled: Boolean! } input OrganizationMemberSecurityInput { - twoFactorEnabled: Boolean - passwordProtected: Boolean + twoFactorEnabled: Boolean + passwordProtected: Boolean } -""" -Autogenerated input type of OrganizationMemberUpdate -""" +"""Autogenerated input type of OrganizationMemberUpdate""" input OrganizationMemberUpdateInput { - """ - Autogenerated input type of OrganizationMemberUpdate - """ - clientMutationId: String - """ - Autogenerated input type of OrganizationMemberUpdate - """ - id: ID! - """ - Autogenerated input type of OrganizationMemberUpdate - """ - role: OrganizationMemberRole - """ - Autogenerated input type of OrganizationMemberUpdate - """ - sso: OrganizationMemberSSOInput +"""Autogenerated input type of OrganizationMemberUpdate""" + clientMutationId: String +"""Autogenerated input type of OrganizationMemberUpdate""" + id: ID! +"""Autogenerated input type of OrganizationMemberUpdate""" + role: OrganizationMemberRole +"""Autogenerated input type of OrganizationMemberUpdate""" + sso: OrganizationMemberSSOInput } -""" -Autogenerated return type of OrganizationMemberUpdate. -""" +"""Autogenerated return type of OrganizationMemberUpdate.""" type OrganizationMemberUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - organizationMember: OrganizationMember +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + organizationMember: OrganizationMember } -""" -Permissions information about what actions the current user can do against the organization -""" +"""Permissions information about what actions the current user can do against the organization""" type OrganizationPermissions { - """ - Whether the user can create agent tokens - """ - agentTokenCreate: Permission - """ - Whether the user can access agent tokens - """ - agentTokenView: Permission - """ - Whether the user can create a see a list of agents in organization - """ - agentView: Permission - """ - Whether the user can access audit events for the organization - """ - auditEventsView: Permission - """ - Whether the user can change the notification services for the organization - """ - notificationServiceUpdate: Permission - """ - Whether the user can view and manage billing for the organization - """ - organizationBillingUpdate: Permission - """ - Whether the user can invite members from an organization - """ - organizationInvitationCreate: Permission - """ - Whether the user can update/remove members from an organization - """ - organizationMemberUpdate: Permission - """ - Whether the user can see members in the organization - """ - organizationMemberView: Permission - """ - Whether the user can see sensitive information about members in the organization - """ - organizationMemberViewSensitive: Permission - """ - Whether the user can change the organization name and related source code provider settings - """ - organizationUpdate: Permission - """ - Whether the user can create a new pipeline in the organization - """ - pipelineCreate: Permission - """ - Whether the user can create a new pipeline without adding it to any teams within the organization - """ - pipelineCreateWithoutTeams: Permission - """ - Whether the user can create a see a list of pipelines in organization - """ - pipelineView: Permission - """ - Whether the user can change SSO Providers for the organization - """ - ssoProviderCreate: Permission - """ - Whether the user can change SSO Providers for the organization - """ - ssoProviderUpdate: Permission - """ - Whether the user can create a see a list of suites in organization - """ - suiteView: Permission - """ - Whether the user can administer one or all the teams in the organization - """ - teamAdmin: Permission - """ - Whether the user can create teams for the organization - """ - teamCreate: Permission - """ - Whether the user can toggle teams on/off for the organization - """ - teamEnabledChange: Permission - """ - Whether the user can see teams in the organization - """ - teamView: Permission -} - -""" -Single sign-on settings for an organization -""" +"""Whether the user can create agent tokens""" + agentTokenCreate: Permission +"""Whether the user can access agent tokens""" + agentTokenView: Permission +"""Whether the user can create a see a list of agents in organization""" + agentView: Permission +"""Whether the user can access audit events for the organization""" + auditEventsView: Permission +"""Whether the user can change the notification services for the organization""" + notificationServiceUpdate: Permission +"""Whether the user can view and manage billing for the organization""" + organizationBillingUpdate: Permission +"""Whether the user can invite members from an organization""" + organizationInvitationCreate: Permission +"""Whether the user can update/remove members from an organization""" + organizationMemberUpdate: Permission +"""Whether the user can see members in the organization""" + organizationMemberView: Permission +"""Whether the user can see sensitive information about members in the organization""" + organizationMemberViewSensitive: Permission +"""Whether the user can change the organization name and related source code provider settings""" + organizationUpdate: Permission +"""Whether the user can create a new pipeline in the organization""" + pipelineCreate: Permission +"""Whether the user can create a new pipeline without adding it to any teams within the organization""" + pipelineCreateWithoutTeams: Permission +"""Whether the user can create a see a list of pipelines in organization""" + pipelineView: Permission +"""Whether the user can change SSO Providers for the organization""" + ssoProviderCreate: Permission +"""Whether the user can change SSO Providers for the organization""" + ssoProviderUpdate: Permission +"""Whether the user can create a see a list of suites in organization""" + suiteView: Permission +"""Whether the user can administer one or all the teams in the organization""" + teamAdmin: Permission +"""Whether the user can create teams for the organization""" + teamCreate: Permission +"""Whether the user can toggle teams on/off for the organization""" + teamEnabledChange: Permission +"""Whether the user can see teams in the organization""" + teamView: Permission +} + +"""Single sign-on settings for an organization""" type OrganizationSSO { - """ - Whether this account is configured for single sign-on - """ - isEnabled: Boolean! - """ - The single sign-on provider for this organization - """ - provider: OrganizationSSOProvider +"""Whether this account is configured for single sign-on""" + isEnabled: Boolean! +"""The single sign-on provider for this organization""" + provider: OrganizationSSOProvider } -""" -Single sign-on provider information for an organization -""" +"""Single sign-on provider information for an organization""" type OrganizationSSOProvider { - name: String! + name: String! } -""" -Information about pagination in a connection. -""" +"""Information about pagination in a connection.""" type PageInfo { - """ - When paginating forwards, the cursor to continue. - """ - endCursor: String - """ - When paginating forwards, are there more items? - """ - hasNextPage: Boolean! - """ - When paginating backwards, are there more items? - """ - hasPreviousPage: Boolean! - """ - When paginating backwards, the cursor to continue. - """ - startCursor: String +"""When paginating forwards, the cursor to continue.""" + endCursor: String +"""When paginating forwards, are there more items?""" + hasNextPage: Boolean! +"""When paginating backwards, are there more items?""" + hasPreviousPage: Boolean! +"""When paginating backwards, the cursor to continue.""" + startCursor: String } -""" -The result of checking a permissions -""" +"""The result of checking a permissions""" type Permission { - allowed: Boolean! - code: String - message: String -} - -""" -A pipeline -""" -type Pipeline implements Node { - """ - Whether existing builds can be rebuilt as new builds. - """ - allowRebuilds: Boolean - """ - Whether this pipeline has been archived - """ - archived: Boolean! - """ - The time when the pipeline was archived - """ - archivedAt: DateTime - """ - The user that archived this pipeline - """ - archivedBy: User - """ - A branch filter pattern to limit which pushed branches trigger builds on this pipeline. - """ - branchConfiguration: String - """ - Choose to keep builds or remove them after a set time period. Pipelines are scanned once a day for builds that can be removed according to these settings. - """ - buildRetentionEnabled: Boolean - """ - The minimum number of builds to keep in the pipeline regardless of how old the builds are. - """ - buildRetentionNumber: Int - """ - How long is a build kept before it is automatically removed. - """ - buildRetentionPeriod: BuildRetentionPeriods - """ - Returns the builds for this pipeline - """ - builds( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - state: [BuildStates!] - """ - Use `%default` to search by the Pipelines default branch - """ - branch: [String!] - commit: [String!] - metaData: [String!] - createdAtFrom: DateTime - createdAtTo: DateTime - ): BuildConnection - """ - When a new build is created on a branch, any previous builds that are running on the same branch will be automatically cancelled - """ - cancelIntermediateBuilds: Boolean! - """ - Limit which branches build cancelling applies to, for example `!main` will ensure that the main branch won't have it's builds automatically cancelled. - """ - cancelIntermediateBuildsBranchFilter: String - cluster: Cluster - """ - The color of the pipeline - """ - color: String - """ - The shortest length to which any git commit ID may be truncated while guaranteeing referring to a unique commit - """ - commitShortLength: Int! - """ - The time when the pipeline was created - """ - createdAt: DateTime - """ - The user who created the pipeline - """ - createdBy: User - """ - The default branch for this pipeline - """ - defaultBranch: String - """ - The default timeout in minutes for all command steps in this pipeline. This can still be overridden in any command step - """ - defaultTimeoutInMinutes: Int - """ - The short description of the pipeline - """ - description: String - """ - The emoji of the pipeline - """ - emoji: String - """ - Returns true if the viewer has favorited this pipeline - """ - favorite: Boolean! - id: ID! - jobs( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - type: [JobTypes!] - state: [JobStates!] - priority: JobPrioritySearch - agentQueryRules: [String!] - concurrency: JobConcurrencySearch - """ - Whether or not the command job passed. Passing `false` will return all failed jobs (including "soft failed" jobs) - """ - passed: Boolean - """ - Filtering jobs based on related step information - """ - step: JobStepSearch - """ - Order the jobs - """ - order: JobOrder - ): JobConnection - """ - The maximum timeout in minutes for all command steps in this pipeline. Any command step without a timeout or with a timeout greater than this value will be set to this value. - """ - maximumTimeoutInMinutes: Int - metrics(first: Int, last: Int): PipelineMetricConnection - """ - The name of the pipeline - """ - name: String! - """ - The next build number in the sequence - """ - nextBuildNumber: Int! - organization: Organization! - permissions: PipelinePermissions! - """ - Whether this pipeline is visible to everyone, including people outside this organization - """ - public: Boolean! - """ - The repository for this pipeline - """ - repository: Repository - """ - Schedules for this pipeline - """ - schedules(first: Int): PipelineScheduleConnection - """ - When a new build is created on a branch, any previous builds that haven't yet started on the same branch will be automatically marked as skipped. - """ - skipIntermediateBuilds: Boolean! - """ - Limit which branches build skipping applies to, for example `!main` will ensure that the main branch won't have it's builds automatically skipped. - """ - skipIntermediateBuildsBranchFilter: String - """ - The slug of the pipeline - """ - slug: String! - steps: PipelineSteps - """ - Tags that have been given to this pipeline - """ - tags: [PipelineTag!]! - """ - Teams associated with this pipeline - """ - teams( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - """ - Search for teams associated that this pipeline is assigned to - """ - search: String - """ - Order the pipelines returned - """ - order: TeamPipelineOrder - ): TeamPipelineConnection - """ - The URL for the pipeline - """ - url: String! - """ - The UUID of the pipeline - """ - uuid: String! - """ - Whether this pipeline is visible to everyone, including people outside this organization - """ - visibility: PipelineVisibility! - """ - The URL to use in your repository settings for commit webhooks - """ - webhookURL: String! -} - -""" -The access levels that can be assigned to a pipeline -""" + allowed: Boolean! + code: String + message: String +} + +"""A pipeline""" +type Pipeline implements Node{ +"""Whether existing builds can be rebuilt as new builds.""" + allowRebuilds: Boolean +"""Whether this pipeline has been archived""" + archived: Boolean! +"""The time when the pipeline was archived""" + archivedAt: DateTime +"""The user that archived this pipeline""" + archivedBy: User +"""A branch filter pattern to limit which pushed branches trigger builds on this pipeline.""" + branchConfiguration: String +"""Choose to keep builds or remove them after a set time period. Pipelines are scanned once a day for builds that can be removed according to these settings.""" + buildRetentionEnabled: Boolean +"""The minimum number of builds to keep in the pipeline regardless of how old the builds are.""" + buildRetentionNumber: Int +"""How long is a build kept before it is automatically removed.""" + buildRetentionPeriod: BuildRetentionPeriods +"""Returns the builds for this pipeline""" + builds( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + state: [BuildStates!] +"""Use `%default` to search by the Pipelines default branch""" + branch: [String!] + commit: [String!] + metaData: [String!] + createdAtFrom: DateTime + createdAtTo: DateTime + ): BuildConnection +"""When a new build is created on a branch, any previous builds that are running on the same branch will be automatically cancelled""" + cancelIntermediateBuilds: Boolean! +"""Limit which branches build cancelling applies to, for example `!main` will ensure that the main branch won't have it's builds automatically cancelled.""" + cancelIntermediateBuildsBranchFilter: String + cluster: Cluster +"""The color of the pipeline""" + color: String +"""The shortest length to which any git commit ID may be truncated while guaranteeing referring to a unique commit""" + commitShortLength: Int! +"""The time when the pipeline was created""" + createdAt: DateTime +"""The user who created the pipeline""" + createdBy: User +"""The default branch for this pipeline""" + defaultBranch: String +"""The default timeout in minutes for all command steps in this pipeline. This can still be overridden in any command step""" + defaultTimeoutInMinutes: Int +"""The short description of the pipeline""" + description: String +"""The emoji of the pipeline""" + emoji: String +"""Returns true if the viewer has favorited this pipeline""" + favorite: Boolean! + id: ID! + jobs( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + type: [JobTypes!] + state: [JobStates!] + priority: JobPrioritySearch + agentQueryRules: [String!] + concurrency: JobConcurrencySearch +"""Whether or not the command job passed. Passing `false` will return all failed jobs (including "soft failed" jobs)""" + passed: Boolean +"""Filtering jobs based on related step information""" + step: JobStepSearch +"""Order the jobs""" + order: JobOrder + ): JobConnection +"""The maximum timeout in minutes for all command steps in this pipeline. Any command step without a timeout or with a timeout greater than this value will be set to this value.""" + maximumTimeoutInMinutes: Int + metrics( + first: Int + last: Int + ): PipelineMetricConnection +"""The name of the pipeline""" + name: String! +"""The next build number in the sequence""" + nextBuildNumber: Int! + organization: Organization! + permissions: PipelinePermissions! + pipelineTemplate: PipelineTemplate +"""Whether this pipeline is visible to everyone, including people outside this organization""" + public: Boolean! +"""The repository for this pipeline""" + repository: Repository +"""Schedules for this pipeline""" + schedules( + first: Int + ): PipelineScheduleConnection +"""When a new build is created on a branch, any previous builds that haven't yet started on the same branch will be automatically marked as skipped.""" + skipIntermediateBuilds: Boolean! +"""Limit which branches build skipping applies to, for example `!main` will ensure that the main branch won't have it's builds automatically skipped.""" + skipIntermediateBuildsBranchFilter: String +"""The slug of the pipeline""" + slug: String! + steps: PipelineSteps +"""Tags that have been given to this pipeline""" + tags: [PipelineTag!]! +"""Teams associated with this pipeline""" + teams( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String +"""Search for teams associated that this pipeline is assigned to""" + search: String +"""Order the pipelines returned""" + order: TeamPipelineOrder + ): TeamPipelineConnection +"""The URL for the pipeline""" + url: String! +"""The UUID of the pipeline""" + uuid: String! +"""Whether this pipeline is visible to everyone, including people outside this organization""" + visibility: PipelineVisibility! +"""The URL to use in your repository settings for commit webhooks""" + webhookURL: String! +} + +"""The access levels that can be assigned to a pipeline""" enum PipelineAccessLevels { - """ - Allows edits, builds and reads - """ - MANAGE_BUILD_AND_READ - """ - Allows builds and read only - """ - BUILD_AND_READ - """ - Read only - no builds or edits - """ - READ_ONLY +"""Allows edits, builds and reads""" + MANAGE_BUILD_AND_READ +"""Allows builds and read only""" + BUILD_AND_READ +"""Read only - no builds or edits""" + READ_ONLY } -""" -Autogenerated input type of PipelineArchive -""" +"""Autogenerated input type of PipelineArchive""" input PipelineArchiveInput { - """ - Autogenerated input type of PipelineArchive - """ - clientMutationId: String - """ - Autogenerated input type of PipelineArchive - """ - id: ID! +"""Autogenerated input type of PipelineArchive""" + clientMutationId: String +"""Autogenerated input type of PipelineArchive""" + id: ID! } -""" -Autogenerated return type of PipelineArchive. -""" +"""Autogenerated return type of PipelineArchive.""" type PipelineArchivePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipeline: Pipeline! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipeline: Pipeline! } -type PipelineConnection implements Connection { - count: Int! - edges: [PipelineEdge] - pageInfo: PageInfo +type PipelineConnection implements Connection{ + count: Int! + edges: [PipelineEdge] + pageInfo: PageInfo } -""" -Autogenerated input type of PipelineCreate -""" +"""Autogenerated input type of PipelineCreate""" input PipelineCreateInput { - """ - Autogenerated input type of PipelineCreate - """ - clientMutationId: String - """ - Autogenerated input type of PipelineCreate - """ - organizationId: ID! - """ - Autogenerated input type of PipelineCreate - """ - name: String! - """ - Autogenerated input type of PipelineCreate - """ - description: String - """ - Autogenerated input type of PipelineCreate - """ - emoji: String - """ - Autogenerated input type of PipelineCreate - """ - color: String - """ - Autogenerated input type of PipelineCreate - """ - visibility: PipelineVisibility - """ - Autogenerated input type of PipelineCreate - """ - repository: PipelineRepositoryInput! - """ - Autogenerated input type of PipelineCreate - """ - steps: PipelineStepsInput! - """ - Autogenerated input type of PipelineCreate - """ - skipIntermediateBuilds: Boolean - """ - Autogenerated input type of PipelineCreate - """ - skipIntermediateBuildsBranchFilter: String - """ - Autogenerated input type of PipelineCreate - """ - cancelIntermediateBuilds: Boolean - """ - Autogenerated input type of PipelineCreate - """ - cancelIntermediateBuildsBranchFilter: String - """ - Autogenerated input type of PipelineCreate - """ - allowRebuilds: Boolean - """ - Autogenerated input type of PipelineCreate - """ - defaultTimeoutInMinutes: Int - """ - Autogenerated input type of PipelineCreate - """ - maximumTimeoutInMinutes: Int - """ - Autogenerated input type of PipelineCreate - """ - buildRetentionEnabled: Boolean - """ - Autogenerated input type of PipelineCreate - """ - buildRetentionPeriod: BuildRetentionPeriods - """ - Autogenerated input type of PipelineCreate - """ - buildRetentionNumber: Int - """ - Autogenerated input type of PipelineCreate - """ - teams: [PipelineTeamAssignmentInput!] - """ - Autogenerated input type of PipelineCreate - """ - defaultBranch: String - """ - Autogenerated input type of PipelineCreate - """ - nextBuildNumber: Int - """ - Autogenerated input type of PipelineCreate - """ - clusterId: ID - """ - Autogenerated input type of PipelineCreate - """ - tags: [PipelineTagInput!] - """ - Autogenerated input type of PipelineCreate - """ - branchConfiguration: String -} - -""" -Autogenerated return type of PipelineCreate. -""" +"""Autogenerated input type of PipelineCreate""" + clientMutationId: String +"""Autogenerated input type of PipelineCreate""" + organizationId: ID! +"""Autogenerated input type of PipelineCreate""" + name: String! +"""Autogenerated input type of PipelineCreate""" + description: String +"""Autogenerated input type of PipelineCreate""" + emoji: String +"""Autogenerated input type of PipelineCreate""" + color: String +"""Autogenerated input type of PipelineCreate""" + visibility: PipelineVisibility +"""Autogenerated input type of PipelineCreate""" + repository: PipelineRepositoryInput! +"""Autogenerated input type of PipelineCreate""" + steps: PipelineStepsInput! +"""Autogenerated input type of PipelineCreate""" + skipIntermediateBuilds: Boolean +"""Autogenerated input type of PipelineCreate""" + skipIntermediateBuildsBranchFilter: String +"""Autogenerated input type of PipelineCreate""" + cancelIntermediateBuilds: Boolean +"""Autogenerated input type of PipelineCreate""" + cancelIntermediateBuildsBranchFilter: String +"""Autogenerated input type of PipelineCreate""" + allowRebuilds: Boolean +"""Autogenerated input type of PipelineCreate""" + defaultTimeoutInMinutes: Int +"""Autogenerated input type of PipelineCreate""" + maximumTimeoutInMinutes: Int +"""Autogenerated input type of PipelineCreate""" + buildRetentionEnabled: Boolean +"""Autogenerated input type of PipelineCreate""" + buildRetentionPeriod: BuildRetentionPeriods +"""Autogenerated input type of PipelineCreate""" + buildRetentionNumber: Int +"""Autogenerated input type of PipelineCreate""" + teams: [PipelineTeamAssignmentInput!] +"""Autogenerated input type of PipelineCreate""" + defaultBranch: String +"""Autogenerated input type of PipelineCreate""" + nextBuildNumber: Int +"""Autogenerated input type of PipelineCreate""" + clusterId: ID +"""Autogenerated input type of PipelineCreate""" + tags: [PipelineTagInput!] +"""Autogenerated input type of PipelineCreate""" + branchConfiguration: String +} + +"""Autogenerated return type of PipelineCreate.""" type PipelineCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - cluster: Cluster - organization: Organization! - pipeline: Pipeline! - pipelineEdge: PipelineEdge! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + cluster: Cluster + organization: Organization! + pipeline: Pipeline! + pipelineEdge: PipelineEdge! } -""" -Autogenerated input type of PipelineCreateWebhook -""" +"""Autogenerated input type of PipelineCreateWebhook""" input PipelineCreateWebhookInput { - """ - Autogenerated input type of PipelineCreateWebhook - """ - clientMutationId: String - """ - Autogenerated input type of PipelineCreateWebhook - """ - id: ID! +"""Autogenerated input type of PipelineCreateWebhook""" + clientMutationId: String +"""Autogenerated input type of PipelineCreateWebhook""" + id: ID! } -""" -Autogenerated return type of PipelineCreateWebhook. -""" +"""Autogenerated return type of PipelineCreateWebhook.""" type PipelineCreateWebhookPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipelineID: ID! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipelineID: ID! } -""" -Autogenerated input type of PipelineDelete -""" +"""Autogenerated input type of PipelineDelete""" input PipelineDeleteInput { - """ - Autogenerated input type of PipelineDelete - """ - clientMutationId: String - """ - Autogenerated input type of PipelineDelete - """ - id: ID! +"""Autogenerated input type of PipelineDelete""" + clientMutationId: String +"""Autogenerated input type of PipelineDelete""" + id: ID! } -""" -Autogenerated return type of PipelineDelete. -""" +"""Autogenerated return type of PipelineDelete.""" type PipelineDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedPipelineID: ID! - organization: Organization! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedPipelineID: ID! + organization: Organization! } type PipelineEdge { - cursor: String! - node: Pipeline + cursor: String! + node: Pipeline } -""" -Autogenerated input type of PipelineFavorite -""" +"""Autogenerated input type of PipelineFavorite""" input PipelineFavoriteInput { - """ - Autogenerated input type of PipelineFavorite - """ - clientMutationId: String - """ - Autogenerated input type of PipelineFavorite - """ - id: ID! - """ - Autogenerated input type of PipelineFavorite - """ - favorite: Boolean! +"""Autogenerated input type of PipelineFavorite""" + clientMutationId: String +"""Autogenerated input type of PipelineFavorite""" + id: ID! +"""Autogenerated input type of PipelineFavorite""" + favorite: Boolean! } -""" -Autogenerated return type of PipelineFavorite. -""" +"""Autogenerated return type of PipelineFavorite.""" type PipelineFavoritePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipeline: Pipeline +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipeline: Pipeline } -""" -A metric for a pipeline -""" -type PipelineMetric implements Node { - id: ID! - """ - The label of this metric - """ - label: ID! - """ - The URL for this metric - """ - url: String - """ - The value for this metric - """ - value: String -} - -type PipelineMetricConnection implements Connection { - count: Int! - edges: [PipelineMetricEdge] - pageInfo: PageInfo +"""A metric for a pipeline""" +type PipelineMetric implements Node{ + id: ID! +"""The label of this metric""" + label: ID! +"""The URL for this metric""" + url: String +"""The value for this metric""" + value: String +} + +type PipelineMetricConnection implements Connection{ + count: Int! + edges: [PipelineMetricEdge] + pageInfo: PageInfo } type PipelineMetricEdge { - cursor: String! - node: PipelineMetric + cursor: String! + node: PipelineMetric } -""" -The different orders you can sort pipelines by -""" +"""The different orders you can sort pipelines by""" enum PipelineOrders { - """ - Order by name alphabetically - """ - NAME - """ - Order by favorites first alphabetically, then the rest of the pipelines alphabetically - """ - NAME_WITH_FAVORITES_FIRST - """ - Order by the most recently created pipelines first - """ - RECENTLY_CREATED - """ - Order by relevance when searching for pipelines - """ - RELEVANCE +"""Order by name alphabetically""" + NAME +"""Order by favorites first alphabetically, then the rest of the pipelines alphabetically""" + NAME_WITH_FAVORITES_FIRST +"""Order by the most recently created pipelines first""" + RECENTLY_CREATED +"""Order by relevance when searching for pipelines""" + RELEVANCE } -""" -Permission information about what actions the current user can do against the pipeline -""" +"""Permission information about what actions the current user can do against the pipeline""" type PipelinePermissions { - """ - Whether the user can create builds on this pipeline - """ - buildCreate: Permission! - """ - Whether the user can delete this pipeline - """ - pipelineDelete: Permission! - """ - Whether the user can favorite this pipeline - """ - pipelineFavorite: Permission! - """ - Whether the user can create schedules on this pipeline - """ - pipelineScheduleCreate: Permission! - """ - Whether the user can edit the settings of this pipeline - """ - pipelineUpdate: Permission! -} - -""" -Repository information for a pipeline -""" +"""Whether the user can create builds on this pipeline""" + buildCreate: Permission! +"""Whether the user can delete this pipeline""" + pipelineDelete: Permission! +"""Whether the user can favorite this pipeline""" + pipelineFavorite: Permission! +"""Whether the user can create schedules on this pipeline""" + pipelineScheduleCreate: Permission! +"""Whether the user can edit the settings of this pipeline""" + pipelineUpdate: Permission! +} + +"""Repository information for a pipeline""" input PipelineRepositoryInput { - """ - Repository information for a pipeline - """ - url: String! +"""Repository information for a pipeline""" + url: String! } -""" -Autogenerated input type of PipelineRotateWebhookURL -""" +"""Autogenerated input type of PipelineRotateWebhookURL""" input PipelineRotateWebhookURLInput { - """ - Autogenerated input type of PipelineRotateWebhookURL - """ - clientMutationId: String - """ - Autogenerated input type of PipelineRotateWebhookURL - """ - id: ID! +"""Autogenerated input type of PipelineRotateWebhookURL""" + clientMutationId: String +"""Autogenerated input type of PipelineRotateWebhookURL""" + id: ID! } -""" -Autogenerated return type of PipelineRotateWebhookURL. -""" +"""Autogenerated return type of PipelineRotateWebhookURL.""" type PipelineRotateWebhookURLPayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipeline: Pipeline! -} - -""" -A schedule of when a build should automatically triggered for a Pipeline -""" -type PipelineSchedule implements Node { - """ - The branch to use for builds that this schedule triggers. Defaults to to the default branch in the Pipeline - """ - branch: String - """ - Returns the builds created by this schedule - """ - builds( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - ): BuildConnection - """ - The commit to use for builds that this schedule triggers. Defaults to `HEAD` - """ - commit: String - """ - The time when this schedule was created - """ - createdAt: DateTime - createdBy: User - """ - A definition of the trigger build schedule in cron syntax - """ - cronline: String! - """ - If this Pipeline schedule is currently enabled - """ - enabled: Boolean - """ - Environment variables passed to any triggered builds - """ - env: [String!] - """ - The time when this schedule failed - """ - failedAt: DateTime - """ - If the last attempt at triggering this scheduled build fails, this will be the reason - """ - failedMessage: String - id: ID! - """ - A short description of the Pipeline schedule - """ - label: String! - """ - The message to use for builds that this schedule triggers - """ - message: String - """ - The time when this schedule will create a build next - """ - nextBuildAt: DateTime - permissions: PipelineSchedulePermissions! - pipeline: Pipeline - """ - The UUID of the Pipeline schedule - """ - uuid: String! -} - -type PipelineScheduleConnection implements Connection { - count: Int! - edges: [PipelineScheduleEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of PipelineScheduleCreate -""" +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipeline: Pipeline! +} + +"""A schedule of when a build should automatically triggered for a Pipeline""" +type PipelineSchedule implements Node{ +"""The branch to use for builds that this schedule triggers. Defaults to to the default branch in the Pipeline""" + branch: String +"""Returns the builds created by this schedule""" + builds( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + ): BuildConnection +"""The commit to use for builds that this schedule triggers. Defaults to `HEAD`""" + commit: String +"""The time when this schedule was created""" + createdAt: DateTime + createdBy: User +"""A definition of the trigger build schedule in cron syntax""" + cronline: String! +"""If this Pipeline schedule is currently enabled""" + enabled: Boolean +"""Environment variables passed to any triggered builds""" + env: [String!] +"""The time when this schedule failed""" + failedAt: DateTime +"""If the last attempt at triggering this scheduled build fails, this will be the reason""" + failedMessage: String + id: ID! +"""A short description of the Pipeline schedule""" + label: String! +"""The message to use for builds that this schedule triggers""" + message: String +"""The time when this schedule will create a build next""" + nextBuildAt: DateTime + permissions: PipelineSchedulePermissions! + pipeline: Pipeline +"""The UUID of the Pipeline schedule""" + uuid: String! +} + +type PipelineScheduleConnection implements Connection{ + count: Int! + edges: [PipelineScheduleEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of PipelineScheduleCreate""" input PipelineScheduleCreateInput { - """ - Autogenerated input type of PipelineScheduleCreate - """ - clientMutationId: String - """ - Autogenerated input type of PipelineScheduleCreate - """ - pipelineID: ID! - """ - Autogenerated input type of PipelineScheduleCreate - """ - label: String - """ - Autogenerated input type of PipelineScheduleCreate - """ - cronline: String - """ - Autogenerated input type of PipelineScheduleCreate - """ - message: String - """ - Autogenerated input type of PipelineScheduleCreate - """ - commit: String - """ - Autogenerated input type of PipelineScheduleCreate - """ - branch: String - """ - Autogenerated input type of PipelineScheduleCreate - """ - env: String - """ - Autogenerated input type of PipelineScheduleCreate - """ - enabled: Boolean -} - -""" -Autogenerated return type of PipelineScheduleCreate. -""" +"""Autogenerated input type of PipelineScheduleCreate""" + clientMutationId: String +"""Autogenerated input type of PipelineScheduleCreate""" + pipelineID: ID! +"""Autogenerated input type of PipelineScheduleCreate""" + label: String +"""Autogenerated input type of PipelineScheduleCreate""" + cronline: String +"""Autogenerated input type of PipelineScheduleCreate""" + message: String +"""Autogenerated input type of PipelineScheduleCreate""" + commit: String +"""Autogenerated input type of PipelineScheduleCreate""" + branch: String +"""Autogenerated input type of PipelineScheduleCreate""" + env: String +"""Autogenerated input type of PipelineScheduleCreate""" + enabled: Boolean +} + +"""Autogenerated return type of PipelineScheduleCreate.""" type PipelineScheduleCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipeline: Pipeline! - pipelineScheduleEdge: PipelineScheduleEdge! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipeline: Pipeline! + pipelineScheduleEdge: PipelineScheduleEdge! } -""" -Autogenerated input type of PipelineScheduleDelete -""" +"""Autogenerated input type of PipelineScheduleDelete""" input PipelineScheduleDeleteInput { - """ - Autogenerated input type of PipelineScheduleDelete - """ - clientMutationId: String - """ - Autogenerated input type of PipelineScheduleDelete - """ - id: ID! +"""Autogenerated input type of PipelineScheduleDelete""" + clientMutationId: String +"""Autogenerated input type of PipelineScheduleDelete""" + id: ID! } -""" -Autogenerated return type of PipelineScheduleDelete. -""" +"""Autogenerated return type of PipelineScheduleDelete.""" type PipelineScheduleDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedPipelineScheduleID: ID! - pipeline: Pipeline +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedPipelineScheduleID: ID! + pipeline: Pipeline } type PipelineScheduleEdge { - cursor: String! - node: PipelineSchedule + cursor: String! + node: PipelineSchedule } -""" -Permission information about what actions the current user can do against the pipeline schedule -""" +"""Permission information about what actions the current user can do against the pipeline schedule""" type PipelineSchedulePermissions { - """ - Whether the user can delete the schedule - """ - pipelineScheduleDelete: Permission - """ - Whether the user can update the schedule - """ - pipelineScheduleUpdate: Permission +"""Whether the user can delete the schedule""" + pipelineScheduleDelete: Permission +"""Whether the user can update the schedule""" + pipelineScheduleUpdate: Permission } -""" -Autogenerated input type of PipelineScheduleUpdate -""" +"""Autogenerated input type of PipelineScheduleUpdate""" input PipelineScheduleUpdateInput { - """ - Autogenerated input type of PipelineScheduleUpdate - """ - clientMutationId: String - """ - Autogenerated input type of PipelineScheduleUpdate - """ - id: ID! - """ - Autogenerated input type of PipelineScheduleUpdate - """ - label: String - """ - Autogenerated input type of PipelineScheduleUpdate - """ - cronline: String - """ - Autogenerated input type of PipelineScheduleUpdate - """ - message: String - """ - Autogenerated input type of PipelineScheduleUpdate - """ - commit: String - """ - Autogenerated input type of PipelineScheduleUpdate - """ - branch: String - """ - Autogenerated input type of PipelineScheduleUpdate - """ - env: String - """ - Autogenerated input type of PipelineScheduleUpdate - """ - enabled: Boolean -} - -""" -Autogenerated return type of PipelineScheduleUpdate. -""" +"""Autogenerated input type of PipelineScheduleUpdate""" + clientMutationId: String +"""Autogenerated input type of PipelineScheduleUpdate""" + id: ID! +"""Autogenerated input type of PipelineScheduleUpdate""" + label: String +"""Autogenerated input type of PipelineScheduleUpdate""" + cronline: String +"""Autogenerated input type of PipelineScheduleUpdate""" + message: String +"""Autogenerated input type of PipelineScheduleUpdate""" + commit: String +"""Autogenerated input type of PipelineScheduleUpdate""" + branch: String +"""Autogenerated input type of PipelineScheduleUpdate""" + env: String +"""Autogenerated input type of PipelineScheduleUpdate""" + enabled: Boolean +} + +"""Autogenerated return type of PipelineScheduleUpdate.""" type PipelineScheduleUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipelineSchedule: PipelineSchedule! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipelineSchedule: PipelineSchedule! } -""" -A Pipeline identifier using a slug, and optionally negated with a leading `!` -""" +"""A Pipeline identifier using a slug, and optionally negated with a leading `!`""" scalar PipelineSelector -""" -Steps defined on a pipeline -""" +"""Steps defined on a pipeline""" type PipelineSteps { - """ - A YAML representation of the pipeline steps - """ - yaml: YAML +"""A YAML representation of the pipeline steps""" + yaml: YAML } -""" -Step definition for a pipeline -""" +"""Step definition for a pipeline""" input PipelineStepsInput { - """ - Step definition for a pipeline - """ - yaml: String! +"""Step definition for a pipeline""" + yaml: String! } -""" -A tag associated with a pipeline -""" +"""A tag associated with a pipeline""" type PipelineTag { - """ - The label for this tag - """ - label: String! +"""The label for this tag""" + label: String! } -""" -Tag associated with a pipeline -""" +"""Tag associated with a pipeline""" input PipelineTagInput { - """ - Tag associated with a pipeline - """ - label: String! +"""Tag associated with a pipeline""" + label: String! } -""" -Used to assign teams to pipelines -""" +"""Used to assign teams to pipelines""" input PipelineTeamAssignmentInput { - """ - Used to assign teams to pipelines - """ - id: ID! - """ - Used to assign teams to pipelines - """ - accessLevel: PipelineAccessLevels -} - -""" -Autogenerated input type of PipelineUnarchive -""" +"""Used to assign teams to pipelines""" + id: ID! +"""Used to assign teams to pipelines""" + accessLevel: PipelineAccessLevels +} + +"""A template defining a fixed step configuration for a pipeline""" +type PipelineTemplate implements Node{ +"""A YAML representation of the step configuration""" + configuration: YAML! +"""The time when the template was created""" + createdAt: DateTime! +"""The user who created the template""" + createdBy: User! +"""The short description of the template""" + description: String + id: ID! +"""The name of the template""" + name: String! +"""The last time the template was changed""" + updatedAt: DateTime! +"""The user who last updated the template""" + updatedBy: User! +"""The UUID for the template""" + uuid: ID! +} + +"""Autogenerated input type of PipelineUnarchive""" input PipelineUnarchiveInput { - """ - Autogenerated input type of PipelineUnarchive - """ - clientMutationId: String - """ - Autogenerated input type of PipelineUnarchive - """ - id: ID! +"""Autogenerated input type of PipelineUnarchive""" + clientMutationId: String +"""Autogenerated input type of PipelineUnarchive""" + id: ID! } -""" -Autogenerated return type of PipelineUnarchive. -""" +"""Autogenerated return type of PipelineUnarchive.""" type PipelineUnarchivePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipeline: Pipeline! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipeline: Pipeline! } -""" -Autogenerated input type of PipelineUpdate -""" +"""Autogenerated input type of PipelineUpdate""" input PipelineUpdateInput { - """ - Autogenerated input type of PipelineUpdate - """ - clientMutationId: String - """ - Autogenerated input type of PipelineUpdate - """ - id: ID! - """ - Autogenerated input type of PipelineUpdate - """ - name: String - """ - Autogenerated input type of PipelineUpdate - """ - description: String - """ - Autogenerated input type of PipelineUpdate - """ - emoji: String - """ - Autogenerated input type of PipelineUpdate - """ - color: String - """ - Autogenerated input type of PipelineUpdate - """ - visibility: PipelineVisibility - """ - Autogenerated input type of PipelineUpdate - """ - repository: PipelineRepositoryInput - """ - Autogenerated input type of PipelineUpdate - """ - steps: PipelineStepsInput - """ - Autogenerated input type of PipelineUpdate - """ - defaultBranch: String - """ - Autogenerated input type of PipelineUpdate - """ - nextBuildNumber: Int - """ - Autogenerated input type of PipelineUpdate - """ - skipIntermediateBuilds: Boolean - """ - Autogenerated input type of PipelineUpdate - """ - skipIntermediateBuildsBranchFilter: String - """ - Autogenerated input type of PipelineUpdate - """ - cancelIntermediateBuilds: Boolean - """ - Autogenerated input type of PipelineUpdate - """ - cancelIntermediateBuildsBranchFilter: String - """ - Autogenerated input type of PipelineUpdate - """ - allowRebuilds: Boolean - """ - Autogenerated input type of PipelineUpdate - """ - defaultTimeoutInMinutes: Int - """ - Autogenerated input type of PipelineUpdate - """ - maximumTimeoutInMinutes: Int - """ - Autogenerated input type of PipelineUpdate - """ - buildRetentionEnabled: Boolean - """ - Autogenerated input type of PipelineUpdate - """ - buildRetentionPeriod: BuildRetentionPeriods - """ - Autogenerated input type of PipelineUpdate - """ - buildRetentionNumber: Int - """ - Autogenerated input type of PipelineUpdate - """ - clusterId: ID - """ - Autogenerated input type of PipelineUpdate - """ - archived: Boolean - """ - Autogenerated input type of PipelineUpdate - """ - tags: [PipelineTagInput!] - """ - Autogenerated input type of PipelineUpdate - """ - branchConfiguration: String -} - -""" -Autogenerated return type of PipelineUpdate. -""" +"""Autogenerated input type of PipelineUpdate""" + clientMutationId: String +"""Autogenerated input type of PipelineUpdate""" + id: ID! +"""Autogenerated input type of PipelineUpdate""" + name: String +"""Autogenerated input type of PipelineUpdate""" + description: String +"""Autogenerated input type of PipelineUpdate""" + emoji: String +"""Autogenerated input type of PipelineUpdate""" + color: String +"""Autogenerated input type of PipelineUpdate""" + visibility: PipelineVisibility +"""Autogenerated input type of PipelineUpdate""" + repository: PipelineRepositoryInput +"""Autogenerated input type of PipelineUpdate""" + steps: PipelineStepsInput +"""Autogenerated input type of PipelineUpdate""" + defaultBranch: String +"""Autogenerated input type of PipelineUpdate""" + nextBuildNumber: Int +"""Autogenerated input type of PipelineUpdate""" + skipIntermediateBuilds: Boolean +"""Autogenerated input type of PipelineUpdate""" + skipIntermediateBuildsBranchFilter: String +"""Autogenerated input type of PipelineUpdate""" + cancelIntermediateBuilds: Boolean +"""Autogenerated input type of PipelineUpdate""" + cancelIntermediateBuildsBranchFilter: String +"""Autogenerated input type of PipelineUpdate""" + allowRebuilds: Boolean +"""Autogenerated input type of PipelineUpdate""" + defaultTimeoutInMinutes: Int +"""Autogenerated input type of PipelineUpdate""" + maximumTimeoutInMinutes: Int +"""Autogenerated input type of PipelineUpdate""" + buildRetentionEnabled: Boolean +"""Autogenerated input type of PipelineUpdate""" + buildRetentionPeriod: BuildRetentionPeriods +"""Autogenerated input type of PipelineUpdate""" + buildRetentionNumber: Int +"""Autogenerated input type of PipelineUpdate""" + clusterId: ID +"""Autogenerated input type of PipelineUpdate""" + archived: Boolean +"""Autogenerated input type of PipelineUpdate""" + tags: [PipelineTagInput!] +"""Autogenerated input type of PipelineUpdate""" + branchConfiguration: String +} + +"""Autogenerated return type of PipelineUpdate.""" type PipelineUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipeline: Pipeline! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipeline: Pipeline! } -""" -The visibility of the pipeline -""" +"""The visibility of the pipeline""" enum PipelineVisibility { - """ - The pipeline is public - """ - PUBLIC - """ - The pipeline is private - """ - PRIVATE -} - -""" -A pull request on a provider -""" -type PullRequest { - id: String! -} - -""" -The query root for this schema -""" -type Query { - """ - Find an agent by its slug - """ - agent( - """ - The UUID for the agent, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb` - """ - slug: ID! - ): Agent - """ - Find an agent token by its slug - """ - agentToken( - """ - The UUID for the agent token, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb` - """ - slug: ID! - ): AgentToken - """ - Find a API Access Token code - """ - apiAccessTokenCode( - """ - The code provided by the Auth API - """ - code: ID! - ): APIAccessTokenCode - """ - Find an artifact by its UUID - """ - artifact(uuid: ID!): Artifact - """ - Find an audit event via its uuid - """ - auditEvent( - """ - The UUID for the audit event i.e. `0bd5ea7c-89b3-4f40-8ca3-ffac805771eb` - """ - uuid: ID! - ): AuditEvent - """ - Find a build - """ - build( - """ - The number of the build, prefixed with its organization and pipeline. i.e. `acme-inc/my-pipeline/123` - """ - slug: ID - """ - The UUID of the build - """ - uuid: ID - ): Build - """ - Find a GraphQL snippet - """ - graphQLSnippet( - """ - The UUID for this GraphQL snippet - """ - uuid: String! - ): GraphQLSnippet - """ - Find a build job - """ - job(uuid: ID!): Job - """ - Fetches an object given its ID. - """ - node( - """ - ID of the object. - """ - id: ID! - ): Node - """ - Find a notification service via its UUID - """ - notificationService( - """ - The UUID for the notification service i.e. `0bd5ea7c-89b3-4f40-8ca3-ffac805771eb` - """ - uuid: ID! - ): NotificationService - """ - Find an organization - """ - organization( - """ - The slug of the organization - """ - slug: ID - """ - The UUID of the organization - """ - uuid: ID - ): Organization - """ - Find an organization invitation via its slug - """ - organizationInvitation( - """ - The UUID for the invitation, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb` - """ - slug: ID! - ): OrganizationInvitation - """ - Find an organization membership via its slug - """ - organizationMember( - """ - The UUID for the membership, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb` - """ - slug: ID! - ): OrganizationMember - """ - Find a pipeline - """ - pipeline( - """ - The slug of the pipeline, prefixed with its organization. i.e. `acme-inc/my-pipeline` - """ - slug: ID - """ - The UUID of the pipeline - """ - uuid: ID - ): Pipeline - """ - Find a pipeline schedule by its slug - """ - pipelineSchedule( - """ - The UUID for the pipeline schedule, prefixed by its organization and pipeline's slug i.e. `acme-inc/my-pipeline/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb` - """ - slug: ID! - ): PipelineSchedule - """ - Find an sso provider either using it's slug, or UUID - """ - ssoProvider( - """ - The slug for the sso provider, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb` - """ - slug: ID - """ - The UUID of the sso provider - """ - uuid: ID - ): SSOProvider - """ - Find a team - """ - team( - """ - The slug of the team, prefixed with its organization. i.e. `acme-inc/awesome-team` - """ - slug: ID! - ): Team - """ - Context of the current user using the GraphQL API - """ - viewer: Viewer -} - -""" -A recovery code -""" -type RecoveryCode { - """ - The recovery code. - """ - code: String! - """ - Whether the recovery codes is used - """ - consumed: Boolean! - """ - Foo - """ - consumedAt: String -} - -""" -A batch of recovery codes -""" -type RecoveryCodeBatch { - """ - Whether the batch of recovery codes is active - """ - active: Boolean! - """ - The recovery codes from this batch. Codes are consumed when used, and codes will be included in this list whether consumed or not - """ - codes: [RecoveryCode!]! - id: ID! -} - -""" -A repository associated with a pipeline -""" -type Repository { - """ - The repository’s provider - """ - provider: RepositoryProvider - """ - The git URL for this repository - """ - url: String! -} - -interface RepositoryProvider { - name: String! - url: String - webhookUrl: String -} - -""" -A pipeline's repository is being provided by Beanstalk -""" -type RepositoryProviderBeanstalk implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String -} - -""" -A pipeline's repository is being provided by Bitbucket -""" -type RepositoryProviderBitbucket implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String -} - -""" -A pipeline's repository is being provided by Bitbucket Server -""" -type RepositoryProviderBitbucketServer implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String -} - -""" -A pipeline's repository is being provided by Codebase -""" -type RepositoryProviderCodebase implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String -} - -""" -A pipeline's repository is being provided by GitHub -""" -type RepositoryProviderGithub implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String -} - -""" -A pipeline's repository is being provided by GitHub Enterprise -""" -type RepositoryProviderGithubEnterprise implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String +"""The pipeline is public""" + PUBLIC +"""The pipeline is private""" + PRIVATE } -""" -A pipeline's repository is being provided by GitLab -""" -type RepositoryProviderGitlab implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String +"""A pull request on a provider""" +type PullRequest { + id: String! } -""" -A pipeline's repository is being provided by GitLab Community Edition -""" -type RepositoryProviderGitlabCommunity implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String +"""The query root for this schema""" +type Query { +"""Find an agent by its slug""" + agent( +"""The UUID for the agent, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb`""" + slug: ID! + ): Agent +"""Find an agent token by its slug""" + agentToken( +"""The UUID for the agent token, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb`""" + slug: ID! + ): AgentToken +"""Find a API Access Token code""" + apiAccessTokenCode( +"""The code provided by the Auth API""" + code: ID! + ): APIAccessTokenCode +"""Find an artifact by its UUID""" + artifact( + uuid: ID! + ): Artifact +"""Find an audit event via its uuid""" + auditEvent( +"""The UUID for the audit event i.e. `0bd5ea7c-89b3-4f40-8ca3-ffac805771eb`""" + uuid: ID! + ): AuditEvent +"""Find a build""" + build( +"""The number of the build, prefixed with its organization and pipeline. i.e. `acme-inc/my-pipeline/123`""" + slug: ID +"""The UUID of the build""" + uuid: ID + ): Build +"""Find a GraphQL snippet""" + graphQLSnippet( +"""The UUID for this GraphQL snippet""" + uuid: String! + ): GraphQLSnippet +"""Find a build job""" + job( + uuid: ID! + ): Job +"""Fetches an object given its ID.""" + node( +"""ID of the object.""" + id: ID! + ): Node +"""Find a notification service via its UUID""" + notificationService( +"""The UUID for the notification service i.e. `0bd5ea7c-89b3-4f40-8ca3-ffac805771eb`""" + uuid: ID! + ): NotificationService +"""Find an organization""" + organization( +"""The slug of the organization""" + slug: ID +"""The UUID of the organization""" + uuid: ID + ): Organization +"""Find an organization invitation via its slug""" + organizationInvitation( +"""The UUID for the invitation, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb`""" + slug: ID! + ): OrganizationInvitation +"""Find an organization membership via its slug""" + organizationMember( +"""The UUID for the membership, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb`""" + slug: ID! + ): OrganizationMember +"""Find a pipeline""" + pipeline( +"""The slug of the pipeline, prefixed with its organization. i.e. `acme-inc/my-pipeline`""" + slug: ID +"""The UUID of the pipeline""" + uuid: ID + ): Pipeline +"""Find a pipeline schedule by its slug""" + pipelineSchedule( +"""The UUID for the pipeline schedule, prefixed by its organization and pipeline's slug i.e. `acme-inc/my-pipeline/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb`""" + slug: ID! + ): PipelineSchedule +"""Find an sso provider either using it's slug, or UUID""" + ssoProvider( +"""The slug for the sso provider, prefixed by its organization's slug i.e. `acme-inc/0bd5ea7c-89b3-4f40-8ca3-ffac805771eb`""" + slug: ID +"""The UUID of the sso provider""" + uuid: ID + ): SSOProvider +"""Find a team""" + team( +"""The slug of the team, prefixed with its organization. i.e. `acme-inc/awesome-team`""" + slug: ID! + ): Team +"""Context of the current user using the GraphQL API""" + viewer: Viewer +} + +"""A recovery code""" +type RecoveryCode { +"""The recovery code.""" + code: String! +"""Whether the recovery codes is used""" + consumed: Boolean! +"""Foo""" + consumedAt: String } -""" -A pipeline's repository is being provided by GitLab Enterprise Edition -""" -type RepositoryProviderGitlabEnterprise implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String +"""A batch of recovery codes""" +type RecoveryCodeBatch { +"""Whether the batch of recovery codes is active""" + active: Boolean! +"""The recovery codes from this batch. Codes are consumed when used, and codes will be included in this list whether consumed or not""" + codes: [RecoveryCode!]! + id: ID! } -""" -A pipeline's repository is being provided by a service unknown to Buildkite -""" -type RepositoryProviderUnknown implements RepositoryProvider { - """ - The name of the provider - """ - name: String! - """ - This URL to the provider’s web interface - """ - url: String - """ - The URL to use when setting up webhooks from the provider to trigger Buildkite builds - """ - webhookUrl: String +"""A repository associated with a pipeline""" +type Repository { +"""The repository’s provider""" + provider: RepositoryProvider +"""The git URL for this repository""" + url: String! } -""" -An aggregate of resource usage, grouped by day and resource. -""" +interface RepositoryProvider { + name: String! + url: String + webhookUrl: String +} + +"""A pipeline's repository is being provided by Beanstalk""" +type RepositoryProviderBeanstalk implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by Bitbucket""" +type RepositoryProviderBitbucket implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by Bitbucket Server""" +type RepositoryProviderBitbucketServer implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by Codebase""" +type RepositoryProviderCodebase implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by GitHub""" +type RepositoryProviderGithub implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by GitHub Enterprise""" +type RepositoryProviderGithubEnterprise implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by GitLab""" +type RepositoryProviderGitlab implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by GitLab Community Edition""" +type RepositoryProviderGitlabCommunity implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by GitLab Enterprise Edition""" +type RepositoryProviderGitlabEnterprise implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""A pipeline's repository is being provided by a service unknown to Buildkite""" +type RepositoryProviderUnknown implements RepositoryProvider{ +"""The name of the provider""" + name: String! +"""This URL to the provider’s web interface""" + url: String +"""The URL to use when setting up webhooks from the provider to trigger Buildkite builds""" + webhookUrl: String +} + +"""An aggregate of resource usage, grouped by day and resource.""" interface ResourceUsageInterface { - """ - An aggregate of resource usage, grouped by day and resource. - """ - aggregatedOn: ISO8601Date! +"""An aggregate of resource usage, grouped by day and resource.""" + aggregatedOn: ISO8601Date! } -""" -All types of billable resources -""" +"""All types of billable resources""" enum ResourceUsageType { - """ - These records represent a pipeline's job minutes usage for a single day - """ - JOB_MINUTES - """ - These records represent a suite's test executions usage for a single day - """ - TEST_EXECUTIONS +"""These records represent a pipeline's job minutes usage for a single day""" + JOB_MINUTES +"""These records represent a suite's test executions usage for a single day""" + TEST_EXECUTIONS } type SCMPipelineSettings { - id: ID! + id: ID! } type SCMRepositoryHost { - id: ID! + id: ID! } type SCMService { - id: ID! + id: ID! } type SSOAuthorization { - """ - The time when this SSO Authorization was created - """ - createdAt: DateTime! - """ - The time when this SSO Authorization was expired - """ - expiredAt: DateTime - id: ID! - """ - Details around the identity provided by the SSO provider - """ - identity: SSOAuthorizationIdentity - """ - The time when this SSO Authorization was manually revoked - """ - revokedAt: DateTime - """ - The SSO provider associated with this authorization - """ - ssoProvider: SSOProvider! - """ - The current state of the SSO Authorization - """ - state: SSOAuthorizationState! - """ - The user associated with this authorization - """ - user: User - """ - The time when this SSO Authorization was destroyed because the user logged out - """ - userSessionDestroyedAt: DateTime - """ - The public UUID for this SSO authorization - """ - uuid: String! -} - -type SSOAuthorizationConnection implements Connection { - count: Int! - edges: [SSOAuthorizationEdge] - pageInfo: PageInfo +"""The time when this SSO Authorization was created""" + createdAt: DateTime! +"""The time when this SSO Authorization was expired""" + expiredAt: DateTime + id: ID! +"""Details around the identity provided by the SSO provider""" + identity: SSOAuthorizationIdentity +"""The time when this SSO Authorization was manually revoked""" + revokedAt: DateTime +"""The SSO provider associated with this authorization""" + ssoProvider: SSOProvider! +"""The current state of the SSO Authorization""" + state: SSOAuthorizationState! +"""The user associated with this authorization""" + user: User +"""The time when this SSO Authorization was destroyed because the user logged out""" + userSessionDestroyedAt: DateTime +"""The public UUID for this SSO authorization""" + uuid: String! +} + +type SSOAuthorizationConnection implements Connection{ + count: Int! + edges: [SSOAuthorizationEdge] + pageInfo: PageInfo } type SSOAuthorizationEdge { - cursor: String! - node: SSOAuthorization + cursor: String! + node: SSOAuthorization } type SSOAuthorizationIdentity { - """ - The avatar URL provided in this identity - """ - avatarURL: String - """ - The email addresses provided in this identity - """ - email: String - """ - The name provided in this identity - """ - name: String - """ - The identifier provided in this identity - """ - uid: String +"""The avatar URL provided in this identity""" + avatarURL: String +"""The email addresses provided in this identity""" + email: String +"""The name provided in this identity""" + name: String +"""The identifier provided in this identity""" + uid: String } -""" -All the possible states an SSO Authorization -""" +"""All the possible states an SSO Authorization""" enum SSOAuthorizationState { - """ - The authorization has been verified and is in use - """ - VERIFIED - """ - The authorization was verified but has since been destroyed as the user logged out of that session - """ - VERIFIED_USER_SESSION_DESTROYED - """ - The authorization was verified but has since been manually revoked - """ - VERIFIED_REVOKED - """ - The authorization was verified but has since expired - """ - VERIFIED_EXPIRED +"""The authorization has been verified and is in use""" + VERIFIED +"""The authorization was verified but has since been destroyed as the user logged out of that session""" + VERIFIED_USER_SESSION_DESTROYED +"""The authorization was verified but has since been manually revoked""" + VERIFIED_REVOKED +"""The authorization was verified but has since expired""" + VERIFIED_EXPIRED } interface SSOProvider { - createdAt: DateTime! - createdBy: User! - disabledAt: DateTime - disabledBy: User - disabledReason: String - emailDomain: String - emailDomainVerificationAddress: String - emailDomainVerifiedAt: DateTime - enabledAt: DateTime - enabledBy: User - id: ID! - note: String - organization: Organization - pinSessionToIpAddress: Boolean - sessionDurationInHours: Int - state: SSOProviderStates! - testAuthorizationRequired: Boolean - type: SSOProviderTypes! - url: String! - uuid: ID! -} - -type SSOProviderConnection implements Connection { - count: Int! - edges: [SSOProviderEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of SSOProviderCreate -""" + createdAt: DateTime! + createdBy: User! + disabledAt: DateTime + disabledBy: User + disabledReason: String + emailDomain: String + emailDomainVerificationAddress: String + emailDomainVerifiedAt: DateTime + enabledAt: DateTime + enabledBy: User + id: ID! + note: String + organization: Organization + pinSessionToIpAddress: Boolean + sessionDurationInHours: Int + state: SSOProviderStates! + testAuthorizationRequired: Boolean + type: SSOProviderTypes! + url: String! + uuid: ID! +} + +type SSOProviderConnection implements Connection{ + count: Int! + edges: [SSOProviderEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of SSOProviderCreate""" input SSOProviderCreateInput { - """ - Autogenerated input type of SSOProviderCreate - """ - clientMutationId: String - """ - Autogenerated input type of SSOProviderCreate - """ - organizationId: ID! - """ - Autogenerated input type of SSOProviderCreate - """ - type: SSOProviderTypes! - """ - Autogenerated input type of SSOProviderCreate - """ - note: String - """ - Autogenerated input type of SSOProviderCreate - """ - sessionDurationInHours: Int - """ - Autogenerated input type of SSOProviderCreate - """ - pinSessionToIpAddress: Boolean - """ - Autogenerated input type of SSOProviderCreate - """ - emailDomain: String - """ - Autogenerated input type of SSOProviderCreate - """ - emailDomainVerificationAddress: String - """ - Autogenerated input type of SSOProviderCreate - """ - identityProvider: SSOProviderSAMLIdP - """ - Autogenerated input type of SSOProviderCreate - """ - digestMethod: SSOProviderSAMLXMLSecurity - """ - Autogenerated input type of SSOProviderCreate - """ - signatureMethod: SSOProviderSAMLRSAXMLSecurity - """ - Autogenerated input type of SSOProviderCreate - """ - githubOrganizationName: String - """ - Autogenerated input type of SSOProviderCreate - """ - googleHostedDomain: String - """ - Autogenerated input type of SSOProviderCreate - """ - discloseGoogleHostedDomain: Boolean -} - -""" -Autogenerated return type of SSOProviderCreate. -""" +"""Autogenerated input type of SSOProviderCreate""" + clientMutationId: String +"""Autogenerated input type of SSOProviderCreate""" + organizationId: ID! +"""Autogenerated input type of SSOProviderCreate""" + type: SSOProviderTypes! +"""Autogenerated input type of SSOProviderCreate""" + note: String +"""Autogenerated input type of SSOProviderCreate""" + sessionDurationInHours: Int +"""Autogenerated input type of SSOProviderCreate""" + pinSessionToIpAddress: Boolean +"""Autogenerated input type of SSOProviderCreate""" + emailDomain: String +"""Autogenerated input type of SSOProviderCreate""" + emailDomainVerificationAddress: String +"""Autogenerated input type of SSOProviderCreate""" + identityProvider: SSOProviderSAMLIdP +"""Autogenerated input type of SSOProviderCreate""" + digestMethod: SSOProviderSAMLXMLSecurity +"""Autogenerated input type of SSOProviderCreate""" + signatureMethod: SSOProviderSAMLRSAXMLSecurity +"""Autogenerated input type of SSOProviderCreate""" + githubOrganizationName: String +"""Autogenerated input type of SSOProviderCreate""" + googleHostedDomain: String +"""Autogenerated input type of SSOProviderCreate""" + discloseGoogleHostedDomain: Boolean +} + +"""Autogenerated return type of SSOProviderCreate.""" type SSOProviderCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - organization: Organization! - ssoProvider: SSOProvider! - ssoProviderEdge: SSOProviderEdge! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + organization: Organization! + ssoProvider: SSOProvider! + ssoProviderEdge: SSOProviderEdge! } -""" -Autogenerated input type of SSOProviderDelete -""" +"""Autogenerated input type of SSOProviderDelete""" input SSOProviderDeleteInput { - """ - Autogenerated input type of SSOProviderDelete - """ - clientMutationId: String - """ - Autogenerated input type of SSOProviderDelete - """ - id: ID! +"""Autogenerated input type of SSOProviderDelete""" + clientMutationId: String +"""Autogenerated input type of SSOProviderDelete""" + id: ID! } -""" -Autogenerated return type of SSOProviderDelete. -""" +"""Autogenerated return type of SSOProviderDelete.""" type SSOProviderDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedSSOProviderId: ID! - organization: Organization! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedSSOProviderId: ID! + organization: Organization! } -""" -Autogenerated input type of SSOProviderDisable -""" +"""Autogenerated input type of SSOProviderDisable""" input SSOProviderDisableInput { - """ - Autogenerated input type of SSOProviderDisable - """ - clientMutationId: String - """ - Autogenerated input type of SSOProviderDisable - """ - id: ID! - """ - Autogenerated input type of SSOProviderDisable - """ - disabledReason: String +"""Autogenerated input type of SSOProviderDisable""" + clientMutationId: String +"""Autogenerated input type of SSOProviderDisable""" + id: ID! +"""Autogenerated input type of SSOProviderDisable""" + disabledReason: String } -""" -Autogenerated return type of SSOProviderDisable. -""" +"""Autogenerated return type of SSOProviderDisable.""" type SSOProviderDisablePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - ssoProvider: SSOProvider! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + ssoProvider: SSOProvider! } type SSOProviderEdge { - cursor: String! - node: SSOProvider + cursor: String! + node: SSOProvider } -""" -Autogenerated input type of SSOProviderEnable -""" +"""Autogenerated input type of SSOProviderEnable""" input SSOProviderEnableInput { - """ - Autogenerated input type of SSOProviderEnable - """ - clientMutationId: String - """ - Autogenerated input type of SSOProviderEnable - """ - id: ID! +"""Autogenerated input type of SSOProviderEnable""" + clientMutationId: String +"""Autogenerated input type of SSOProviderEnable""" + id: ID! } -""" -Autogenerated return type of SSOProviderEnable. -""" +"""Autogenerated return type of SSOProviderEnable.""" type SSOProviderEnablePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - ssoProvider: SSOProvider! -} - -""" -Single sign-on provided by GitHub -""" -type SSOProviderGitHubApp implements Node & SSOProvider { - """ - The time when this SSO Provider was created - """ - createdAt: DateTime! - """ - The user that created this SSO Provider - """ - createdBy: User! - """ - The time when this SSO Provider was disabled - """ - disabledAt: DateTime - """ - The user that disabled this SSO Provider - """ - disabledBy: User - """ - The reason this SSO Provider was disabled - """ - disabledReason: String - """ - An email domain whose addresses should be offered this SSO Provider during login. - """ - emailDomain: String - emailDomainVerificationAddress: String - emailDomainVerifiedAt: DateTime - """ - The time when this SSO Provider was enabled - """ - enabledAt: DateTime - """ - The user that enabled this SSO Provider - """ - enabledBy: User - """ - The name of the organization on GitHub that the user must be in for an SSO authorization to be verified - """ - githubOrganizationName: String! - id: ID! - """ - An extra message that can be added the Authorization screen of an SSO Provider - """ - note: String - organization: Organization - """ - Defaults to false. If true, users are required to re-authenticate when their IP address changes. - """ - pinSessionToIpAddress: Boolean - """ - How long a session should last before requiring re-authorization. A `null` value indicates an infinite session. - """ - sessionDurationInHours: Int - """ - The current state of the SSO Provider - """ - state: SSOProviderStates! - """ - Whether the SSO Provider requires a test authorization. If true, the provider can not yet be activated. - """ - testAuthorizationRequired: Boolean - """ - The type of SSO Provider - """ - type: SSOProviderTypes! - """ - The authorization URL for this SSO Provider - """ - url: String! - """ - The UUID for this SSO Provider - """ - uuid: ID! -} - -""" -Single sign-on provided by Google -""" -type SSOProviderGoogleGSuite implements Node & SSOProvider { - """ - The time when this SSO Provider was created - """ - createdAt: DateTime! - """ - The user that created this SSO Provider - """ - createdBy: User! - """ - The time when this SSO Provider was disabled - """ - disabledAt: DateTime - """ - The user that disabled this SSO Provider - """ - disabledBy: User - """ - The reason this SSO Provider was disabled - """ - disabledReason: String - """ - Whether or not the hosted domain should be presented to the user during SSO - """ - discloseGoogleHostedDomain: Boolean! - """ - An email domain whose addresses should be offered this SSO Provider during login. - """ - emailDomain: String - emailDomainVerificationAddress: String - emailDomainVerifiedAt: DateTime - """ - The time when this SSO Provider was enabled - """ - enabledAt: DateTime - """ - The user that enabled this SSO Provider - """ - enabledBy: User - """ - The Google hosted domain that is required to be present in OAuth - """ - googleHostedDomain: String! - id: ID! - """ - An extra message that can be added the Authorization screen of an SSO Provider - """ - note: String - organization: Organization - """ - Defaults to false. If true, users are required to re-authenticate when their IP address changes. - """ - pinSessionToIpAddress: Boolean - """ - How long a session should last before requiring re-authorization. A `null` value indicates an infinite session. - """ - sessionDurationInHours: Int - """ - The current state of the SSO Provider - """ - state: SSOProviderStates! - """ - Whether the SSO Provider requires a test authorization. If true, the provider can not yet be activated. - """ - testAuthorizationRequired: Boolean - """ - The type of SSO Provider - """ - type: SSOProviderTypes! - """ - The authorization URL for this SSO Provider - """ - url: String! - """ - The UUID for this SSO Provider - """ - uuid: ID! -} - -""" -Single sign-on provided via SAML -""" -type SSOProviderSAML implements Node & SSOProvider { - """ - The time when this SSO Provider was created - """ - createdAt: DateTime! - """ - The user that created this SSO Provider - """ - createdBy: User! - """ - The algorithm used to calculate the digest value during a SAML exchange - """ - digestMethod: SSOProviderSAMLXMLSecurity! - """ - The time when this SSO Provider was disabled - """ - disabledAt: DateTime - """ - The user that disabled this SSO Provider - """ - disabledBy: User - """ - The reason this SSO Provider was disabled - """ - disabledReason: String - """ - An email domain whose addresses should be offered this SSO Provider during login. - """ - emailDomain: String - emailDomainVerificationAddress: String - emailDomainVerifiedAt: DateTime - """ - The time when this SSO Provider was enabled - """ - enabledAt: DateTime - """ - The user that enabled this SSO Provider - """ - enabledBy: User - id: ID! - """ - Information about the IdP - """ - identityProvider: SSOProviderSAMLIdPType - """ - An extra message that can be added the Authorization screen of an SSO Provider - """ - note: String - organization: Organization - """ - Defaults to false. If true, users are required to re-authenticate when their IP address changes. - """ - pinSessionToIpAddress: Boolean - serviceProvider: SSOProviderSAMLSPType! - """ - How long a session should last before requiring re-authorization. A `null` value indicates an infinite session. - """ - sessionDurationInHours: Int - """ - The algorithm used to calculate the signature value during a SAML exchange - """ - signatureMethod: SSOProviderSAMLRSAXMLSecurity! - """ - The current state of the SSO Provider - """ - state: SSOProviderStates! - """ - Whether the SSO Provider requires a test authorization. If true, the provider can not yet be activated. - """ - testAuthorizationRequired: Boolean - """ - The type of SSO Provider - """ - type: SSOProviderTypes! - """ - The authorization URL for this SSO Provider - """ - url: String! - """ - The UUID for this SSO Provider - """ - uuid: ID! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + ssoProvider: SSOProvider! +} + +"""Single sign-on provided by GitHub""" +type SSOProviderGitHubApp implements Node & SSOProvider{ +"""The time when this SSO Provider was created""" + createdAt: DateTime! +"""The user that created this SSO Provider""" + createdBy: User! +"""The time when this SSO Provider was disabled""" + disabledAt: DateTime +"""The user that disabled this SSO Provider""" + disabledBy: User +"""The reason this SSO Provider was disabled""" + disabledReason: String +"""An email domain whose addresses should be offered this SSO Provider during login.""" + emailDomain: String + emailDomainVerificationAddress: String + emailDomainVerifiedAt: DateTime +"""The time when this SSO Provider was enabled""" + enabledAt: DateTime +"""The user that enabled this SSO Provider""" + enabledBy: User +"""The name of the organization on GitHub that the user must be in for an SSO authorization to be verified""" + githubOrganizationName: String! + id: ID! +"""An extra message that can be added the Authorization screen of an SSO Provider""" + note: String + organization: Organization +"""Defaults to false. If true, users are required to re-authenticate when their IP address changes.""" + pinSessionToIpAddress: Boolean +"""How long a session should last before requiring re-authorization. A `null` value indicates an infinite session.""" + sessionDurationInHours: Int +"""The current state of the SSO Provider""" + state: SSOProviderStates! +"""Whether the SSO Provider requires a test authorization. If true, the provider can not yet be activated.""" + testAuthorizationRequired: Boolean +"""The type of SSO Provider""" + type: SSOProviderTypes! +"""The authorization URL for this SSO Provider""" + url: String! +"""The UUID for this SSO Provider""" + uuid: ID! +} + +"""Single sign-on provided by Google""" +type SSOProviderGoogleGSuite implements Node & SSOProvider{ +"""The time when this SSO Provider was created""" + createdAt: DateTime! +"""The user that created this SSO Provider""" + createdBy: User! +"""The time when this SSO Provider was disabled""" + disabledAt: DateTime +"""The user that disabled this SSO Provider""" + disabledBy: User +"""The reason this SSO Provider was disabled""" + disabledReason: String +"""Whether or not the hosted domain should be presented to the user during SSO""" + discloseGoogleHostedDomain: Boolean! +"""An email domain whose addresses should be offered this SSO Provider during login.""" + emailDomain: String + emailDomainVerificationAddress: String + emailDomainVerifiedAt: DateTime +"""The time when this SSO Provider was enabled""" + enabledAt: DateTime +"""The user that enabled this SSO Provider""" + enabledBy: User +"""The Google hosted domain that is required to be present in OAuth""" + googleHostedDomain: String! + id: ID! +"""An extra message that can be added the Authorization screen of an SSO Provider""" + note: String + organization: Organization +"""Defaults to false. If true, users are required to re-authenticate when their IP address changes.""" + pinSessionToIpAddress: Boolean +"""How long a session should last before requiring re-authorization. A `null` value indicates an infinite session.""" + sessionDurationInHours: Int +"""The current state of the SSO Provider""" + state: SSOProviderStates! +"""Whether the SSO Provider requires a test authorization. If true, the provider can not yet be activated.""" + testAuthorizationRequired: Boolean +"""The type of SSO Provider""" + type: SSOProviderTypes! +"""The authorization URL for this SSO Provider""" + url: String! +"""The UUID for this SSO Provider""" + uuid: ID! +} + +"""Single sign-on provided via SAML""" +type SSOProviderSAML implements Node & SSOProvider{ +"""The time when this SSO Provider was created""" + createdAt: DateTime! +"""The user that created this SSO Provider""" + createdBy: User! +"""The algorithm used to calculate the digest value during a SAML exchange""" + digestMethod: SSOProviderSAMLXMLSecurity! +"""The time when this SSO Provider was disabled""" + disabledAt: DateTime +"""The user that disabled this SSO Provider""" + disabledBy: User +"""The reason this SSO Provider was disabled""" + disabledReason: String +"""An email domain whose addresses should be offered this SSO Provider during login.""" + emailDomain: String + emailDomainVerificationAddress: String + emailDomainVerifiedAt: DateTime +"""The time when this SSO Provider was enabled""" + enabledAt: DateTime +"""The user that enabled this SSO Provider""" + enabledBy: User + id: ID! +"""Information about the IdP""" + identityProvider: SSOProviderSAMLIdPType +"""An extra message that can be added the Authorization screen of an SSO Provider""" + note: String + organization: Organization +"""Defaults to false. If true, users are required to re-authenticate when their IP address changes.""" + pinSessionToIpAddress: Boolean + serviceProvider: SSOProviderSAMLSPType! +"""How long a session should last before requiring re-authorization. A `null` value indicates an infinite session.""" + sessionDurationInHours: Int +"""The algorithm used to calculate the signature value during a SAML exchange""" + signatureMethod: SSOProviderSAMLRSAXMLSecurity! +"""The current state of the SSO Provider""" + state: SSOProviderStates! +"""Whether the SSO Provider requires a test authorization. If true, the provider can not yet be activated.""" + testAuthorizationRequired: Boolean +"""The type of SSO Provider""" + type: SSOProviderTypes! +"""The authorization URL for this SSO Provider""" + url: String! +"""The UUID for this SSO Provider""" + uuid: ID! } input SSOProviderSAMLIdP { - issuer: String - ssoURL: String - certificate: String - metadata: SSOProviderSAMLIdPMetadata + issuer: String + ssoURL: String + certificate: String + metadata: SSOProviderSAMLIdPMetadata } input SSOProviderSAMLIdPMetadata { - xml: XML - url: String + xml: XML + url: String } -""" -Information about the IdP for a SAML SSO Provider -""" +"""Information about the IdP for a SAML SSO Provider""" type SSOProviderSAMLIdPType { - """ - The certificated provided by the IdP - """ - certificate: String - """ - The IdP Issuer value for this SSO Provider - """ - issuer: String - """ - The metadata used to configure this SSO provider if it was provided - """ - metadata: SSOProviderSAMLMetadataType - """ - The name of the IdP Service. Returns nil if no name can be guessed from the SSO URL - """ - name: String - """ - The IdP SSO URL for this SSO Provider - """ - ssoURL: String -} - -""" -SAML metadata used for configuration -""" +"""The certificated provided by the IdP""" + certificate: String +"""The IdP Issuer value for this SSO Provider""" + issuer: String +"""The metadata used to configure this SSO provider if it was provided""" + metadata: SSOProviderSAMLMetadataType +"""The name of the IdP Service. Returns nil if no name can be guessed from the SSO URL""" + name: String +"""The IdP SSO URL for this SSO Provider""" + ssoURL: String +} + +"""SAML metadata used for configuration""" type SSOProviderSAMLMetadataType { - """ - The URL that this metadata can be publicly accessed at - """ - url: String - """ - The XML for this metadata - """ - xml: XML +"""The URL that this metadata can be publicly accessed at""" + url: String +"""The XML for this metadata""" + xml: XML } -""" -XML RSA security algorithms used in the SAML exchange -""" +"""XML RSA security algorithms used in the SAML exchange""" enum SSOProviderSAMLRSAXMLSecurity { - """ - http://www.w3.org/2000/09/xmldsig#rsa-sha1 - """ - RSA_SHA1 - """ - http://www.w3.org/2001/04/xmldsig-more#rsa-sha256 - """ - RSA_SHA256 - """ - http://www.w3.org/2001/04/xmldsig-more#rsa-sha384 - """ - RSA_SHA384 - """ - http://www.w3.org/2001/04/xmldsig-more#rsa-sha512 - """ - RSA_SHA512 +"""http://www.w3.org/2000/09/xmldsig#rsa-sha1""" + RSA_SHA1 +"""http://www.w3.org/2001/04/xmldsig-more#rsa-sha256""" + RSA_SHA256 +"""http://www.w3.org/2001/04/xmldsig-more#rsa-sha384""" + RSA_SHA384 +"""http://www.w3.org/2001/04/xmldsig-more#rsa-sha512""" + RSA_SHA512 } -""" -Information about Buildkite as a SAML Service Provider -""" +"""Information about Buildkite as a SAML Service Provider""" type SSOProviderSAMLSPType { - """ - The IdP Issuer value for this SSO Provider - """ - issuer: String - """ - The metadata used to configure this SSO provider if it was provided - """ - metadata: SSOProviderSAMLMetadataType - """ - The IdP SSO URL for this SSO Provider - """ - ssoURL: String +"""The IdP Issuer value for this SSO Provider""" + issuer: String +"""The metadata used to configure this SSO provider if it was provided""" + metadata: SSOProviderSAMLMetadataType +"""The IdP SSO URL for this SSO Provider""" + ssoURL: String } -""" -XML security algorithms used in the SAML exchange -""" +"""XML security algorithms used in the SAML exchange""" enum SSOProviderSAMLXMLSecurity { - """ - http://www.w3.org/2000/09/xmldsig#sha1 - """ - SHA1 - """ - http://www.w3.org/2001/04/xmlenc#sha256 - """ - SHA256 - """ - http://www.w3.org/2001/04/xmldsig-more#sha384 - """ - SHA384 - """ - http://www.w3.org/2001/04/xmlenc#sha512 - """ - SHA512 +"""http://www.w3.org/2000/09/xmldsig#sha1""" + SHA1 +"""http://www.w3.org/2001/04/xmlenc#sha256""" + SHA256 +"""http://www.w3.org/2001/04/xmldsig-more#sha384""" + SHA384 +"""http://www.w3.org/2001/04/xmlenc#sha512""" + SHA512 } -""" -All the possible states an SSO Provider can be in -""" +"""All the possible states an SSO Provider can be in""" enum SSOProviderStates { - """ - The SSO Provider has been created, but has not been enabled for use yet - """ - CREATED - """ - The SSO Provider has been setup correctly and can be used by users - """ - ENABLED - """ - The SSO Provider has been disabled and can't be used directly - """ - DISABLED +"""The SSO Provider has been created, but has not been enabled for use yet""" + CREATED +"""The SSO Provider has been setup correctly and can be used by users""" + ENABLED +"""The SSO Provider has been disabled and can't be used directly""" + DISABLED } -""" -All the possible SSO Provider types -""" +"""All the possible SSO Provider types""" enum SSOProviderTypes { - """ - An SSO Provider configured to use SAML - """ - SAML - """ - A SSO Provider configured to use Google G Suite for authorization - """ - GOOGLE_GSUITE - """ - A SSO Provider configured to use a GitHub App for authorization - """ - GITHUB_APP +"""An SSO Provider configured to use SAML""" + SAML +"""A SSO Provider configured to use Google G Suite for authorization""" + GOOGLE_GSUITE +"""A SSO Provider configured to use a GitHub App for authorization""" + GITHUB_APP } -""" -Autogenerated input type of SSOProviderUpdate -""" +"""Autogenerated input type of SSOProviderUpdate""" input SSOProviderUpdateInput { - """ - Autogenerated input type of SSOProviderUpdate - """ - clientMutationId: String - """ - Autogenerated input type of SSOProviderUpdate - """ - id: ID! - """ - Autogenerated input type of SSOProviderUpdate - """ - note: String - """ - Autogenerated input type of SSOProviderUpdate - """ - sessionDurationInHours: Int - """ - Autogenerated input type of SSOProviderUpdate - """ - pinSessionToIpAddress: Boolean - """ - Autogenerated input type of SSOProviderUpdate - """ - emailDomain: String - """ - Autogenerated input type of SSOProviderUpdate - """ - emailDomainVerificationAddress: String - """ - Autogenerated input type of SSOProviderUpdate - """ - identityProvider: SSOProviderSAMLIdP - """ - Autogenerated input type of SSOProviderUpdate - """ - digestMethod: SSOProviderSAMLXMLSecurity - """ - Autogenerated input type of SSOProviderUpdate - """ - signatureMethod: SSOProviderSAMLRSAXMLSecurity - """ - Autogenerated input type of SSOProviderUpdate - """ - githubOrganizationName: String - """ - Autogenerated input type of SSOProviderUpdate - """ - googleHostedDomain: String - """ - Autogenerated input type of SSOProviderUpdate - """ - discloseGoogleHostedDomain: Boolean -} - -""" -Autogenerated return type of SSOProviderUpdate. -""" +"""Autogenerated input type of SSOProviderUpdate""" + clientMutationId: String +"""Autogenerated input type of SSOProviderUpdate""" + id: ID! +"""Autogenerated input type of SSOProviderUpdate""" + note: String +"""Autogenerated input type of SSOProviderUpdate""" + sessionDurationInHours: Int +"""Autogenerated input type of SSOProviderUpdate""" + pinSessionToIpAddress: Boolean +"""Autogenerated input type of SSOProviderUpdate""" + emailDomain: String +"""Autogenerated input type of SSOProviderUpdate""" + emailDomainVerificationAddress: String +"""Autogenerated input type of SSOProviderUpdate""" + identityProvider: SSOProviderSAMLIdP +"""Autogenerated input type of SSOProviderUpdate""" + digestMethod: SSOProviderSAMLXMLSecurity +"""Autogenerated input type of SSOProviderUpdate""" + signatureMethod: SSOProviderSAMLRSAXMLSecurity +"""Autogenerated input type of SSOProviderUpdate""" + githubOrganizationName: String +"""Autogenerated input type of SSOProviderUpdate""" + googleHostedDomain: String +"""Autogenerated input type of SSOProviderUpdate""" + discloseGoogleHostedDomain: Boolean +} + +"""Autogenerated return type of SSOProviderUpdate.""" type SSOProviderUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - ssoProvider: SSOProvider! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + ssoProvider: SSOProvider! } interface Step { - conditional: String - dependencies: DependencyConnection - key: String - uuid: String! -} - -""" -A step in a build that runs a command on an agent -""" -type StepCommand implements Step { - """ - The conditional evaluated for this step - """ - conditional: String - """ - Dependencies of this job - """ - dependencies( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - ): DependencyConnection - """ - The user-defined key for this step - """ - key: String - """ - The UUID for this step - """ - uuid: String! -} - -""" -An input step collects information from a user -""" -type StepInput implements Step { - """ - The conditional evaluated for this step - """ - conditional: String - """ - Dependencies of this job - """ - dependencies( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - ): DependencyConnection - """ - The user-defined key for this step - """ - key: String - """ - The UUID for this step - """ - uuid: String! -} - -""" -A trigger step creates a build on another pipeline -""" -type StepTrigger implements Step { - """ - The conditional evaluated for this step - """ - conditional: String - """ - Dependencies of this job - """ - dependencies( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - ): DependencyConnection - """ - The user-defined key for this step - """ - key: String - """ - The UUID for this step - """ - uuid: String! -} - -""" -A wait step waits for all previous steps to have successfully completed before allowing following jobs to continue -""" -type StepWait implements Step { - """ - The conditional evaluated for this step - """ - conditional: String - """ - Dependencies of this job - """ - dependencies( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - ): DependencyConnection - """ - The user-defined key for this step - """ - key: String - """ - The UUID for this step - """ - uuid: String! -} - -""" -Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text. -""" + conditional: String + dependencies: DependencyConnection + key: String + uuid: String! +} + +"""A step in a build that runs a command on an agent""" +type StepCommand implements Step{ +"""The conditional evaluated for this step""" + conditional: String +"""Dependencies of this job""" + dependencies( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + ): DependencyConnection +"""The user-defined key for this step""" + key: String +"""The UUID for this step""" + uuid: String! +} + +"""An input step collects information from a user""" +type StepInput implements Step{ +"""The conditional evaluated for this step""" + conditional: String +"""Dependencies of this job""" + dependencies( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + ): DependencyConnection +"""The user-defined key for this step""" + key: String +"""The UUID for this step""" + uuid: String! +} + +"""A trigger step creates a build on another pipeline""" +type StepTrigger implements Step{ +"""The conditional evaluated for this step""" + conditional: String +"""Dependencies of this job""" + dependencies( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + ): DependencyConnection +"""The user-defined key for this step""" + key: String +"""The UUID for this step""" + uuid: String! +} + +"""A wait step waits for all previous steps to have successfully completed before allowing following jobs to continue""" +type StepWait implements Step{ +"""The conditional evaluated for this step""" + conditional: String +"""Dependencies of this job""" + dependencies( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + ): DependencyConnection +"""The user-defined key for this step""" + key: String +"""The UUID for this step""" + uuid: String! +} + +"""Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.""" scalar String type Subscription { - id: ID! -} - -""" -A suite -""" -type Suite implements Node { - """ - The time when the suite was created - """ - createdAt: DateTime - """ - The default branch for this suite - """ - defaultBranch: String - id: ID! - """ - The name of the suite - """ - name: String! - organization: Organization! - """ - The slug of the suite - """ - slug: String! - """ - Teams associated with this suite - """ - teams( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - """ - Search for teams associated that this suite is assigned to - """ - search: String - """ - Order the suites returned - """ - order: TeamSuiteOrder - ): TeamSuiteConnection - """ - The URL for the suite - """ - url: String! - uuid: String! -} - -""" -The access levels that can be assigned to a suite -""" + id: ID! +} + +"""A suite""" +type Suite implements Node{ +"""The time when the suite was created""" + createdAt: DateTime +"""The default branch for this suite""" + defaultBranch: String + id: ID! +"""The name of the suite""" + name: String! + organization: Organization! +"""The slug of the suite""" + slug: String! +"""Teams associated with this suite""" + teams( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String +"""Search for teams associated that this suite is assigned to""" + search: String +"""Order the suites returned""" + order: TeamSuiteOrder + ): TeamSuiteConnection +"""The URL for the suite""" + url: String! + uuid: String! +} + +"""The access levels that can be assigned to a suite""" enum SuiteAccessLevels { - """ - Allows edits and reads - """ - MANAGE_AND_READ - """ - Read only - """ - READ_ONLY +"""Allows edits and reads""" + MANAGE_AND_READ +"""Read only""" + READ_ONLY } -type SuiteConnection implements Connection { - count: Int! - edges: [SuiteEdge] - pageInfo: PageInfo +type SuiteConnection implements Connection{ + count: Int! + edges: [SuiteEdge] + pageInfo: PageInfo } type SuiteEdge { - cursor: String! - node: Suite + cursor: String! + node: Suite } -""" -The different orders you can sort suites by -""" +"""The different orders you can sort suites by""" enum SuiteOrders { - """ - Order by name alphabetically - """ - NAME - """ - Order by the most recently created suites first - """ - RECENTLY_CREATED - """ - Order by relevance when searching for suites - """ - RELEVANCE +"""Order by name alphabetically""" + NAME +"""Order by the most recently created suites first""" + RECENTLY_CREATED +"""Order by relevance when searching for suites""" + RELEVANCE } -""" -A TOTP configuration -""" +"""A TOTP configuration""" type TOTP { - id: ID! - """ - The recovery code batch associated with this TOTP configuration - """ - recoveryCodes: RecoveryCodeBatch! - """ - Whether the TOTP configuration has been verified yet - """ - verified: Boolean! + id: ID! +"""The recovery code batch associated with this TOTP configuration""" + recoveryCodes: RecoveryCodeBatch! +"""Whether the TOTP configuration has been verified yet""" + verified: Boolean! } -""" -Autogenerated input type of TOTPActivate -""" +"""Autogenerated input type of TOTPActivate""" input TOTPActivateInput { - """ - Autogenerated input type of TOTPActivate - """ - clientMutationId: String - """ - Autogenerated input type of TOTPActivate - """ - id: ID! - """ - Autogenerated input type of TOTPActivate - """ - token: String! +"""Autogenerated input type of TOTPActivate""" + clientMutationId: String +"""Autogenerated input type of TOTPActivate""" + id: ID! +"""Autogenerated input type of TOTPActivate""" + token: String! } -""" -Autogenerated return type of TOTPActivate. -""" +"""Autogenerated return type of TOTPActivate.""" type TOTPActivatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - totp: TOTP! - viewer: Viewer! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + totp: TOTP! + viewer: Viewer! } -""" -Autogenerated input type of TOTPCreate -""" +"""Autogenerated input type of TOTPCreate""" input TOTPCreateInput { - """ - Autogenerated input type of TOTPCreate - """ - clientMutationId: String +"""Autogenerated input type of TOTPCreate""" + clientMutationId: String } -""" -Autogenerated return type of TOTPCreate. -""" +"""Autogenerated return type of TOTPCreate.""" type TOTPCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - """ - The URI to enter into your one-time password generator. Usually presented to the user as a QR Code - """ - provisioningUri: String! - totp: TOTP! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String +"""The URI to enter into your one-time password generator. Usually presented to the user as a QR Code""" + provisioningUri: String! + totp: TOTP! } -""" -Autogenerated input type of TOTPDelete -""" +"""Autogenerated input type of TOTPDelete""" input TOTPDeleteInput { - """ - Autogenerated input type of TOTPDelete - """ - clientMutationId: String - """ - Autogenerated input type of TOTPDelete - """ - id: ID! +"""Autogenerated input type of TOTPDelete""" + clientMutationId: String +"""Autogenerated input type of TOTPDelete""" + id: ID! } -""" -Autogenerated return type of TOTPDelete. -""" +"""Autogenerated return type of TOTPDelete.""" type TOTPDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - viewer: Viewer! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + viewer: Viewer! } -""" -Autogenerated input type of TOTPRecoveryCodesRegenerate -""" +"""Autogenerated input type of TOTPRecoveryCodesRegenerate""" input TOTPRecoveryCodesRegenerateInput { - """ - Autogenerated input type of TOTPRecoveryCodesRegenerate - """ - clientMutationId: String - """ - Autogenerated input type of TOTPRecoveryCodesRegenerate - """ - totpId: ID! +"""Autogenerated input type of TOTPRecoveryCodesRegenerate""" + clientMutationId: String +"""Autogenerated input type of TOTPRecoveryCodesRegenerate""" + totpId: ID! } -""" -Autogenerated return type of TOTPRecoveryCodesRegenerate. -""" +"""Autogenerated return type of TOTPRecoveryCodesRegenerate.""" type TOTPRecoveryCodesRegeneratePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - recoveryCodes: RecoveryCodeBatch! - totp: TOTP! -} - -""" -An organization team -""" -type Team implements Node { - """ - The time when this team was created - """ - createdAt: DateTime! - """ - The user that created this team - """ - createdBy: User - """ - New organization members will be granted this role on this team - """ - defaultMemberRole: TeamMemberRole! - """ - A description of the team - """ - description: String - id: ID! - """ - Add new organization members to this team by default - """ - isDefaultTeam: Boolean! - """ - Users that are part of this team - """ - members( - first: Int - after: String - last: Int - before: String - """ - Search team members named like the given query case insensitively - """ - search: String - """ - Search team members by their role - """ - role: [TeamMemberRole!] - """ - Order the members returned - """ - order: TeamMemberOrder - ): TeamMemberConnection - """ - Whether or not team members can create new pipelines in this team - """ - membersCanCreatePipelines: Boolean! - """ - Whether or not team members can delete pipelines in this team - """ - membersCanDeletePipelines: Boolean! - """ - The name of the team - """ - name: String! - """ - The organization that this team is a part of - """ - organization: Organization - permissions: TeamPermissions! - """ - Pipelines associated with this team - """ - pipelines( - first: Int - after: String - last: Int - before: String - """ - Search pipelines named like the given query case insensitively - """ - search: String - """ - Order the pipelines returned - """ - order: TeamPipelineOrder - ): TeamPipelineConnection - """ - The privacy setting for this team - """ - privacy: TeamPrivacy! - """ - The slug of the team - """ - slug: String! - """ - Suites associated with this team - """ - suites( - first: Int - after: String - last: Int - before: String - """ - Order the suites returned - """ - order: TeamSuiteOrder - ): TeamSuiteConnection - """ - The public UUID for this team - """ - uuid: ID! -} - -type TeamConnection implements Connection { - count: Int! - edges: [TeamEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of TeamCreate -""" +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + recoveryCodes: RecoveryCodeBatch! + totp: TOTP! +} + +"""An organization team""" +type Team implements Node{ +"""The time when this team was created""" + createdAt: DateTime! +"""The user that created this team""" + createdBy: User +"""New organization members will be granted this role on this team""" + defaultMemberRole: TeamMemberRole! +"""A description of the team""" + description: String + id: ID! +"""Add new organization members to this team by default""" + isDefaultTeam: Boolean! +"""Users that are part of this team""" + members( + first: Int + after: String + last: Int + before: String +"""Search team members named like the given query case insensitively""" + search: String +"""Search team members by their role""" + role: [TeamMemberRole!] +"""Order the members returned""" + order: TeamMemberOrder + ): TeamMemberConnection +"""Whether or not team members can create new pipelines in this team""" + membersCanCreatePipelines: Boolean! +"""Whether or not team members can delete pipelines in this team""" + membersCanDeletePipelines: Boolean! +"""The name of the team""" + name: String! +"""The organization that this team is a part of""" + organization: Organization + permissions: TeamPermissions! +"""Pipelines associated with this team""" + pipelines( + first: Int + after: String + last: Int + before: String +"""Search pipelines named like the given query case insensitively""" + search: String +"""Order the pipelines returned""" + order: TeamPipelineOrder + ): TeamPipelineConnection +"""The privacy setting for this team""" + privacy: TeamPrivacy! +"""The slug of the team""" + slug: String! +"""Suites associated with this team""" + suites( + first: Int + after: String + last: Int + before: String +"""Order the suites returned""" + order: TeamSuiteOrder + ): TeamSuiteConnection +"""The public UUID for this team""" + uuid: ID! +} + +type TeamConnection implements Connection{ + count: Int! + edges: [TeamEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of TeamCreate""" input TeamCreateInput { - """ - Autogenerated input type of TeamCreate - """ - clientMutationId: String - """ - Autogenerated input type of TeamCreate - """ - organizationID: ID! - """ - Autogenerated input type of TeamCreate - """ - name: String! - """ - Autogenerated input type of TeamCreate - """ - description: String - """ - Autogenerated input type of TeamCreate - """ - privacy: TeamPrivacy! - """ - Autogenerated input type of TeamCreate - """ - isDefaultTeam: Boolean! - """ - Autogenerated input type of TeamCreate - """ - defaultMemberRole: TeamMemberRole! - """ - Autogenerated input type of TeamCreate - """ - membersCanCreatePipelines: Boolean - """ - Autogenerated input type of TeamCreate - """ - membersCanDeletePipelines: Boolean -} - -""" -Autogenerated return type of TeamCreate. -""" +"""Autogenerated input type of TeamCreate""" + clientMutationId: String +"""Autogenerated input type of TeamCreate""" + organizationID: ID! +"""Autogenerated input type of TeamCreate""" + name: String! +"""Autogenerated input type of TeamCreate""" + description: String +"""Autogenerated input type of TeamCreate""" + privacy: TeamPrivacy! +"""Autogenerated input type of TeamCreate""" + isDefaultTeam: Boolean! +"""Autogenerated input type of TeamCreate""" + defaultMemberRole: TeamMemberRole! +"""Autogenerated input type of TeamCreate""" + membersCanCreatePipelines: Boolean +"""Autogenerated input type of TeamCreate""" + membersCanDeletePipelines: Boolean +} + +"""Autogenerated return type of TeamCreate.""" type TeamCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - organization: Organization! - teamEdge: TeamEdge! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + organization: Organization! + teamEdge: TeamEdge! } -""" -Autogenerated input type of TeamDelete -""" +"""Autogenerated input type of TeamDelete""" input TeamDeleteInput { - """ - Autogenerated input type of TeamDelete - """ - clientMutationId: String - """ - Autogenerated input type of TeamDelete - """ - id: ID! +"""Autogenerated input type of TeamDelete""" + clientMutationId: String +"""Autogenerated input type of TeamDelete""" + id: ID! } -""" -Autogenerated return type of TeamDelete. -""" +"""Autogenerated return type of TeamDelete.""" type TeamDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedTeamID: ID! - organization: Organization! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedTeamID: ID! + organization: Organization! } type TeamEdge { - cursor: String! - node: Team -} - -""" -An member of a team -""" -type TeamMember implements Node { - """ - The time when the team member was added - """ - createdAt: DateTime! - """ - The user that added this team member - """ - createdBy: User - id: ID! - """ - The organization member associated with this team member - """ - organizationMember: OrganizationMember - permissions: TeamMemberPermissions! - """ - The users role within the team - """ - role: TeamMemberRole! - """ - The team associated with this team member - """ - team: Team - """ - The user associated with this team member - """ - user: User - """ - The public UUID for this team member - """ - uuid: ID! -} - -type TeamMemberConnection implements Connection { - count: Int! - edges: [TeamMemberEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of TeamMemberCreate -""" + cursor: String! + node: Team +} + +"""An member of a team""" +type TeamMember implements Node{ +"""The time when the team member was added""" + createdAt: DateTime! +"""The user that added this team member""" + createdBy: User + id: ID! +"""The organization member associated with this team member""" + organizationMember: OrganizationMember + permissions: TeamMemberPermissions! +"""The users role within the team""" + role: TeamMemberRole! +"""The team associated with this team member""" + team: Team +"""The user associated with this team member""" + user: User +"""The public UUID for this team member""" + uuid: ID! +} + +type TeamMemberConnection implements Connection{ + count: Int! + edges: [TeamMemberEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of TeamMemberCreate""" input TeamMemberCreateInput { - """ - Autogenerated input type of TeamMemberCreate - """ - clientMutationId: String - """ - Autogenerated input type of TeamMemberCreate - """ - teamID: ID! - """ - Autogenerated input type of TeamMemberCreate - """ - userID: ID! - """ - Autogenerated input type of TeamMemberCreate - """ - role: TeamMemberRole +"""Autogenerated input type of TeamMemberCreate""" + clientMutationId: String +"""Autogenerated input type of TeamMemberCreate""" + teamID: ID! +"""Autogenerated input type of TeamMemberCreate""" + userID: ID! +"""Autogenerated input type of TeamMemberCreate""" + role: TeamMemberRole } -""" -Autogenerated return type of TeamMemberCreate. -""" +"""Autogenerated return type of TeamMemberCreate.""" type TeamMemberCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - team: Team - teamMemberEdge: TeamMemberEdge +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + team: Team + teamMemberEdge: TeamMemberEdge } -""" -Autogenerated input type of TeamMemberDelete -""" +"""Autogenerated input type of TeamMemberDelete""" input TeamMemberDeleteInput { - """ - Autogenerated input type of TeamMemberDelete - """ - clientMutationId: String - """ - Autogenerated input type of TeamMemberDelete - """ - id: ID! +"""Autogenerated input type of TeamMemberDelete""" + clientMutationId: String +"""Autogenerated input type of TeamMemberDelete""" + id: ID! } -""" -Autogenerated return type of TeamMemberDelete. -""" +"""Autogenerated return type of TeamMemberDelete.""" type TeamMemberDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedTeamMemberID: ID! - team: Team +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedTeamMemberID: ID! + team: Team } type TeamMemberEdge { - cursor: String! - node: TeamMember + cursor: String! + node: TeamMember } -""" -The different orders you can sort team members by -""" +"""The different orders you can sort team members by""" enum TeamMemberOrder { - """ - Order by name alphabetically - """ - NAME - """ - Order by most relevant results when doing a search - """ - RELEVANCE - """ - Order by the most recently added members first - """ - RECENTLY_CREATED +"""Order by name alphabetically""" + NAME +"""Order by most relevant results when doing a search""" + RELEVANCE +"""Order by the most recently added members first""" + RECENTLY_CREATED } -""" -Permissions information about what actions the current user can do against the team membership record -""" +"""Permissions information about what actions the current user can do against the team membership record""" type TeamMemberPermissions { - """ - Whether the user can delete the user from the team - """ - teamMemberDelete: Permission - """ - Whether the user can update the team's members admin status - """ - teamMemberUpdate: Permission +"""Whether the user can delete the user from the team""" + teamMemberDelete: Permission +"""Whether the user can update the team's members admin status""" + teamMemberUpdate: Permission } -""" -The roles a user can be within a team -""" +"""The roles a user can be within a team""" enum TeamMemberRole { - """ - The user is a regular member of the team - """ - MEMBER - """ - The user can manage pipelines and users within the team - """ - MAINTAINER +"""The user is a regular member of the team""" + MEMBER +"""The user can manage pipelines and users within the team""" + MAINTAINER } -""" -Autogenerated input type of TeamMemberUpdate -""" +"""Autogenerated input type of TeamMemberUpdate""" input TeamMemberUpdateInput { - """ - Autogenerated input type of TeamMemberUpdate - """ - clientMutationId: String - """ - Autogenerated input type of TeamMemberUpdate - """ - id: ID! - """ - Autogenerated input type of TeamMemberUpdate - """ - role: TeamMemberRole! +"""Autogenerated input type of TeamMemberUpdate""" + clientMutationId: String +"""Autogenerated input type of TeamMemberUpdate""" + id: ID! +"""Autogenerated input type of TeamMemberUpdate""" + role: TeamMemberRole! } -""" -Autogenerated return type of TeamMemberUpdate. -""" +"""Autogenerated return type of TeamMemberUpdate.""" type TeamMemberUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - teamMember: TeamMember! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + teamMember: TeamMember! } -""" -The different orders you can sort teams by -""" +"""The different orders you can sort teams by""" enum TeamOrder { - """ - Order by name alphabetically - """ - NAME - """ - Order by the most recently created teams first - """ - RECENTLY_CREATED - """ - Order by relevance when searching for teams - """ - RELEVANCE +"""Order by name alphabetically""" + NAME +"""Order by the most recently created teams first""" + RECENTLY_CREATED +"""Order by relevance when searching for teams""" + RELEVANCE } -""" -Permissions information about what actions the current user can do against the team -""" +"""Permissions information about what actions the current user can do against the team""" type TeamPermissions { - """ - Whether the user can see the pipelines within the team - """ - pipelineView: Permission - """ - Whether the user can delete the team - """ - teamDelete: Permission - """ - Whether the user can administer add members from the organization to this team - """ - teamMemberCreate: Permission - """ - Whether the user can add pipelines from other teams to this one - """ - teamPipelineCreate: Permission - """ - Whether the user can add suites from other teams to this one - """ - teamSuiteCreate: Permission - """ - Whether the user can update the team's name and description - """ - teamUpdate: Permission -} - -""" -An pipeline that's been assigned to a team -""" -type TeamPipeline implements Node { - """ - The access level users have to this pipeline - """ - accessLevel: PipelineAccessLevels! - """ - The time when the pipeline was added - """ - createdAt: DateTime! - """ - The user that added this pipeline to the team - """ - createdBy: User - id: ID! - permissions: TeamPipelinePermissions! - """ - The pipeline associated with this team member - """ - pipeline: Pipeline - """ - The team associated with this team member - """ - team: Team - """ - The public UUID for this team member - """ - uuid: ID! -} - -""" -A collection of TeamPipeline records -""" -type TeamPipelineConnection implements Connection { - count: Int! - edges: [TeamPipelineEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of TeamPipelineCreate -""" +"""Whether the user can see the pipelines within the team""" + pipelineView: Permission +"""Whether the user can delete the team""" + teamDelete: Permission +"""Whether the user can administer add members from the organization to this team""" + teamMemberCreate: Permission +"""Whether the user can add pipelines from other teams to this one""" + teamPipelineCreate: Permission +"""Whether the user can add suites from other teams to this one""" + teamSuiteCreate: Permission +"""Whether the user can update the team's name and description""" + teamUpdate: Permission +} + +"""An pipeline that's been assigned to a team""" +type TeamPipeline implements Node{ +"""The access level users have to this pipeline""" + accessLevel: PipelineAccessLevels! +"""The time when the pipeline was added""" + createdAt: DateTime! +"""The user that added this pipeline to the team""" + createdBy: User + id: ID! + permissions: TeamPipelinePermissions! +"""The pipeline associated with this team member""" + pipeline: Pipeline +"""The team associated with this team member""" + team: Team +"""The public UUID for this team member""" + uuid: ID! +} + +"""A collection of TeamPipeline records""" +type TeamPipelineConnection implements Connection{ + count: Int! + edges: [TeamPipelineEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of TeamPipelineCreate""" input TeamPipelineCreateInput { - """ - Autogenerated input type of TeamPipelineCreate - """ - clientMutationId: String - """ - Autogenerated input type of TeamPipelineCreate - """ - teamID: ID! - """ - Autogenerated input type of TeamPipelineCreate - """ - pipelineID: ID! - """ - Autogenerated input type of TeamPipelineCreate - """ - accessLevel: PipelineAccessLevels +"""Autogenerated input type of TeamPipelineCreate""" + clientMutationId: String +"""Autogenerated input type of TeamPipelineCreate""" + teamID: ID! +"""Autogenerated input type of TeamPipelineCreate""" + pipelineID: ID! +"""Autogenerated input type of TeamPipelineCreate""" + accessLevel: PipelineAccessLevels } -""" -Autogenerated return type of TeamPipelineCreate. -""" +"""Autogenerated return type of TeamPipelineCreate.""" type TeamPipelineCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - pipeline: Pipeline - team: Team - teamPipeline: TeamPipeline - teamPipelineEdge: TeamPipelineEdge +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + pipeline: Pipeline + team: Team + teamPipeline: TeamPipeline + teamPipelineEdge: TeamPipelineEdge } -""" -Autogenerated input type of TeamPipelineDelete -""" +"""Autogenerated input type of TeamPipelineDelete""" input TeamPipelineDeleteInput { - """ - Autogenerated input type of TeamPipelineDelete - """ - clientMutationId: String - """ - Autogenerated input type of TeamPipelineDelete - """ - id: ID! - """ - Autogenerated input type of TeamPipelineDelete - """ - force: Boolean +"""Autogenerated input type of TeamPipelineDelete""" + clientMutationId: String +"""Autogenerated input type of TeamPipelineDelete""" + id: ID! +"""Autogenerated input type of TeamPipelineDelete""" + force: Boolean } -""" -Autogenerated return type of TeamPipelineDelete. -""" +"""Autogenerated return type of TeamPipelineDelete.""" type TeamPipelineDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedTeamPipelineID: ID! - team: Team +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedTeamPipelineID: ID! + team: Team } type TeamPipelineEdge { - cursor: String! - node: TeamPipeline + cursor: String! + node: TeamPipeline } -""" -The different orders you can sort pipelines by -""" +"""The different orders you can sort pipelines by""" enum TeamPipelineOrder { - """ - Order by name alphabetically - """ - NAME - """ - Order by most relevant results when doing a search - """ - RELEVANCE - """ - Order by the most recently added pipelines first - """ - RECENTLY_CREATED +"""Order by name alphabetically""" + NAME +"""Order by most relevant results when doing a search""" + RELEVANCE +"""Order by the most recently added pipelines first""" + RECENTLY_CREATED } -""" -Permission information about what actions the current user can do against the team pipelines -""" +"""Permission information about what actions the current user can do against the team pipelines""" type TeamPipelinePermissions { - """ - Whether the user can delete the pipeline from the team - """ - teamPipelineDelete: Permission - """ - Whether the user can update the pipeline connection to the team - """ - teamPipelineUpdate: Permission +"""Whether the user can delete the pipeline from the team""" + teamPipelineDelete: Permission +"""Whether the user can update the pipeline connection to the team""" + teamPipelineUpdate: Permission } -""" -Autogenerated input type of TeamPipelineUpdate -""" +"""Autogenerated input type of TeamPipelineUpdate""" input TeamPipelineUpdateInput { - """ - Autogenerated input type of TeamPipelineUpdate - """ - clientMutationId: String - """ - Autogenerated input type of TeamPipelineUpdate - """ - id: ID! - """ - Autogenerated input type of TeamPipelineUpdate - """ - accessLevel: PipelineAccessLevels! +"""Autogenerated input type of TeamPipelineUpdate""" + clientMutationId: String +"""Autogenerated input type of TeamPipelineUpdate""" + id: ID! +"""Autogenerated input type of TeamPipelineUpdate""" + accessLevel: PipelineAccessLevels! } -""" -Autogenerated return type of TeamPipelineUpdate. -""" +"""Autogenerated return type of TeamPipelineUpdate.""" type TeamPipelineUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - teamPipeline: TeamPipeline! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + teamPipeline: TeamPipeline! } -""" -Whether a team is visible or secret within an organization -""" +"""Whether a team is visible or secret within an organization""" enum TeamPrivacy { - """ - Visible to all members of the organization - """ - VISIBLE - """ - Visible to organization administrators and members - """ - SECRET +"""Visible to all members of the organization""" + VISIBLE +"""Visible to organization administrators and members""" + SECRET } -""" -A Team identifier using a slug, and optionally negated with a leading `!` -""" +"""A Team identifier using a slug, and optionally negated with a leading `!`""" scalar TeamSelector -""" -A suite that's been assigned to a team -""" -type TeamSuite implements Node { - """ - The access level users have to this suite - """ - accessLevel: SuiteAccessLevels! - """ - The time when the suite was added - """ - createdAt: DateTime! - """ - The user that added this suite to the team - """ - createdBy: User - id: ID! - permissions: TeamSuitePermissions! - """ - The suite associated with this team member - """ - suite: Suite - """ - The team associated with this team member - """ - team: Team - """ - The public UUID for this team suite - """ - uuid: String! -} - -""" -A collection of TeamSuite records -""" -type TeamSuiteConnection implements Connection { - count: Int! - edges: [TeamSuiteEdge] - pageInfo: PageInfo -} - -""" -Autogenerated input type of TeamSuiteCreate -""" +"""A suite that's been assigned to a team""" +type TeamSuite implements Node{ +"""The access level users have to this suite""" + accessLevel: SuiteAccessLevels! +"""The time when the suite was added""" + createdAt: DateTime! +"""The user that added this suite to the team""" + createdBy: User + id: ID! + permissions: TeamSuitePermissions! +"""The suite associated with this team member""" + suite: Suite +"""The team associated with this team member""" + team: Team +"""The public UUID for this team suite""" + uuid: String! +} + +"""A collection of TeamSuite records""" +type TeamSuiteConnection implements Connection{ + count: Int! + edges: [TeamSuiteEdge] + pageInfo: PageInfo +} + +"""Autogenerated input type of TeamSuiteCreate""" input TeamSuiteCreateInput { - """ - Autogenerated input type of TeamSuiteCreate - """ - clientMutationId: String - """ - Autogenerated input type of TeamSuiteCreate - """ - teamID: ID! - """ - Autogenerated input type of TeamSuiteCreate - """ - suiteID: ID! - """ - Autogenerated input type of TeamSuiteCreate - """ - accessLevel: SuiteAccessLevels +"""Autogenerated input type of TeamSuiteCreate""" + clientMutationId: String +"""Autogenerated input type of TeamSuiteCreate""" + teamID: ID! +"""Autogenerated input type of TeamSuiteCreate""" + suiteID: ID! +"""Autogenerated input type of TeamSuiteCreate""" + accessLevel: SuiteAccessLevels } -""" -Autogenerated return type of TeamSuiteCreate. -""" +"""Autogenerated return type of TeamSuiteCreate.""" type TeamSuiteCreatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - suite: Suite - team: Team - teamSuite: TeamSuite - teamSuiteEdge: TeamSuiteEdge +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + suite: Suite + team: Team + teamSuite: TeamSuite + teamSuiteEdge: TeamSuiteEdge } -""" -Autogenerated input type of TeamSuiteDelete -""" +"""Autogenerated input type of TeamSuiteDelete""" input TeamSuiteDeleteInput { - """ - Autogenerated input type of TeamSuiteDelete - """ - clientMutationId: String - """ - Autogenerated input type of TeamSuiteDelete - """ - id: ID! - """ - Autogenerated input type of TeamSuiteDelete - """ - force: Boolean +"""Autogenerated input type of TeamSuiteDelete""" + clientMutationId: String +"""Autogenerated input type of TeamSuiteDelete""" + id: ID! +"""Autogenerated input type of TeamSuiteDelete""" + force: Boolean } -""" -Autogenerated return type of TeamSuiteDelete. -""" +"""Autogenerated return type of TeamSuiteDelete.""" type TeamSuiteDeletePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - deletedTeamSuiteID: ID! - team: Team +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + deletedTeamSuiteID: ID! + team: Team } type TeamSuiteEdge { - cursor: String! - node: TeamSuite + cursor: String! + node: TeamSuite } -""" -The different orders you can sort suites by -""" +"""The different orders you can sort suites by""" enum TeamSuiteOrder { - """ - Order by name alphabetically - """ - NAME - """ - Order by most relevant results when doing a search - """ - RELEVANCE - """ - Order by the most recently added suites first - """ - RECENTLY_CREATED +"""Order by name alphabetically""" + NAME +"""Order by most relevant results when doing a search""" + RELEVANCE +"""Order by the most recently added suites first""" + RECENTLY_CREATED } -""" -Permission information about what actions the current user can do against the team suites -""" +"""Permission information about what actions the current user can do against the team suites""" type TeamSuitePermissions { - """ - Whether the user can delete the suite from the team - """ - teamSuiteDelete: Permission - """ - Whether the user can update the suite connection to the team - """ - teamSuiteUpdate: Permission +"""Whether the user can delete the suite from the team""" + teamSuiteDelete: Permission +"""Whether the user can update the suite connection to the team""" + teamSuiteUpdate: Permission } -""" -Autogenerated input type of TeamSuiteUpdate -""" +"""Autogenerated input type of TeamSuiteUpdate""" input TeamSuiteUpdateInput { - """ - Autogenerated input type of TeamSuiteUpdate - """ - clientMutationId: String - """ - Autogenerated input type of TeamSuiteUpdate - """ - id: ID! - """ - Autogenerated input type of TeamSuiteUpdate - """ - accessLevel: SuiteAccessLevels! +"""Autogenerated input type of TeamSuiteUpdate""" + clientMutationId: String +"""Autogenerated input type of TeamSuiteUpdate""" + id: ID! +"""Autogenerated input type of TeamSuiteUpdate""" + accessLevel: SuiteAccessLevels! } -""" -Autogenerated return type of TeamSuiteUpdate. -""" +"""Autogenerated return type of TeamSuiteUpdate.""" type TeamSuiteUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - teamSuite: TeamSuite! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + teamSuite: TeamSuite! } -""" -Autogenerated input type of TeamUpdate -""" +"""Autogenerated input type of TeamUpdate""" input TeamUpdateInput { - """ - Autogenerated input type of TeamUpdate - """ - clientMutationId: String - """ - Autogenerated input type of TeamUpdate - """ - id: ID! - """ - Autogenerated input type of TeamUpdate - """ - name: String! - """ - Autogenerated input type of TeamUpdate - """ - description: String - """ - Autogenerated input type of TeamUpdate - """ - privacy: TeamPrivacy - """ - Autogenerated input type of TeamUpdate - """ - isDefaultTeam: Boolean! - """ - Autogenerated input type of TeamUpdate - """ - defaultMemberRole: TeamMemberRole! - """ - Autogenerated input type of TeamUpdate - """ - membersCanCreatePipelines: Boolean - """ - Autogenerated input type of TeamUpdate - """ - membersCanDeletePipelines: Boolean -} - -""" -Autogenerated return type of TeamUpdate. -""" +"""Autogenerated input type of TeamUpdate""" + clientMutationId: String +"""Autogenerated input type of TeamUpdate""" + id: ID! +"""Autogenerated input type of TeamUpdate""" + name: String! +"""Autogenerated input type of TeamUpdate""" + description: String +"""Autogenerated input type of TeamUpdate""" + privacy: TeamPrivacy +"""Autogenerated input type of TeamUpdate""" + isDefaultTeam: Boolean! +"""Autogenerated input type of TeamUpdate""" + defaultMemberRole: TeamMemberRole! +"""Autogenerated input type of TeamUpdate""" + membersCanCreatePipelines: Boolean +"""Autogenerated input type of TeamUpdate""" + membersCanDeletePipelines: Boolean +} + +"""Autogenerated return type of TeamUpdate.""" type TeamUpdatePayload { - """ - A unique identifier for the client performing the mutation. - """ - clientMutationId: String - team: Team! +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + team: Team! } -""" -A record of test executions usage, aggregated by day and test suite. -""" -type TestExecutionsUsage implements ResourceUsageInterface { - aggregatedOn: ISO8601Date! - """ - The recorded usage. - """ - executions: Int! - suite: Suite - suiteId: ID! +"""A record of test executions usage, aggregated by day and test suite.""" +type TestExecutionsUsage implements ResourceUsageInterface{ + aggregatedOn: ISO8601Date! +"""The recorded usage.""" + executions: Int! + suite: Suite + suiteId: ID! } -""" -A person who hasn’t signed up to Buildkite -""" +"""A person who hasn’t signed up to Buildkite""" type UnregisteredUser { - avatar: Avatar! - """ - The email for the user - """ - email: String - """ - The name of the user - """ - name: String + avatar: Avatar! +"""The email for the user""" + email: String +"""The name of the user""" + name: String } -""" -The possible resource usage types -""" -union UsageUnion = JobMinutesUsage | TestExecutionsUsage +"""The possible resource usage types""" +union UsageUnion =JobMinutesUsage | TestExecutionsUsage -""" -The connection type for UsageUnion. -""" +"""The connection type for UsageUnion.""" type UsageUnionConnection { - """ - A list of edges. - """ - edges: [UsageUnionEdge] - """ - A list of nodes. - """ - nodes: [UsageUnion] - """ - Information to aid in pagination. - """ - pageInfo: PageInfo! +"""A list of edges.""" + edges: [UsageUnionEdge] +"""A list of nodes.""" + nodes: [UsageUnion] +"""Information to aid in pagination.""" + pageInfo: PageInfo! } -""" -An edge in a connection. -""" +"""An edge in a connection.""" type UsageUnionEdge { - """ - A cursor for use in pagination. - """ - cursor: String! - """ - The item at the end of the edge. - """ - node: UsageUnion -} - -""" -A user -""" -type User implements Node { - avatar: Avatar! - """ - If this user account is an official bot managed by Buildkite - """ - bot: Boolean! - """ - Returns builds that this user has created. - """ - builds(first: Int, last: Int, state: [BuildStates!], branch: [String!], metaData: [String!]): BuildConnection - """ - The primary email for the user - """ - email: String! - """ - Does the user have a password set - """ - hasPassword: Boolean! - id: ID! - """ - The name of the user - """ - name: String! - """ - The public UUID of the user - """ - uuid: String! -} - -""" -A User identifier using a UUID, and optionally negated with a leading `!` -""" +"""A cursor for use in pagination.""" + cursor: String! +"""The item at the end of the edge.""" + node: UsageUnion +} + +"""A user""" +type User implements Node{ + avatar: Avatar! +"""If this user account is an official bot managed by Buildkite""" + bot: Boolean! +"""Returns builds that this user has created.""" + builds( + first: Int + last: Int + state: [BuildStates!] + branch: [String!] + metaData: [String!] + ): BuildConnection +"""The primary email for the user""" + email: String! +"""Does the user have a password set""" + hasPassword: Boolean! + id: ID! +"""The name of the user""" + name: String! +"""The public UUID of the user""" + uuid: String! +} + +"""A User identifier using a UUID, and optionally negated with a leading `!`""" scalar UserSelector -""" -Represents the current user session -""" -type Viewer implements Node { - authorizations( - """ - Returns the first _n_ elements from the list. - """ - first: Int - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - """ - Returns the last _n_ elements from the list. - """ - last: Int - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - type: [AuthorizationType!] - ): AuthorizationConnection - builds(first: Int, last: Int, state: [BuildStates!], branch: String, metaData: [String!]): BuildConnection - changelogs(first: Int, last: Int, read: Boolean): ChangelogConnection - """ - Emails associated with the current user - """ - emails(first: Int, last: Int, verified: Boolean): EmailConnection - """ - The ID of the current user - """ - id: ID! - jobs( - first: Int - after: String - last: Int - before: String - type: [JobTypes!] - state: [JobStates!] - priority: JobPrioritySearch - agentQueryRules: [String!] - """ - Order the jobs - """ - order: JobOrder - ): JobConnection - notice(namespace: NoticeNamespaces!, scope: String!): Notice - organizations(first: Int, last: Int): OrganizationConnection - """ - The current user's permissions - """ - permissions: ViewerPermissions! - """ - The user's active TOTP configuration, if any. - - This field is private, requires an escalated session, and cannot be accessed via the public GraphQL API. - """ - totp(id: ID): TOTP - """ - The current user - """ - user: User -} - -""" -Permissions information about what actions the current user can do -""" +"""Represents the current user session""" +type Viewer implements Node{ + authorizations( +"""Returns the first _n_ elements from the list.""" + first: Int +"""Returns the elements in the list that come after the specified cursor.""" + after: String +"""Returns the last _n_ elements from the list.""" + last: Int +"""Returns the elements in the list that come before the specified cursor.""" + before: String + type: [AuthorizationType!] + ): AuthorizationConnection + builds( + first: Int + last: Int + state: [BuildStates!] + branch: String + metaData: [String!] + ): BuildConnection + changelogs( + first: Int + last: Int + read: Boolean + ): ChangelogConnection +"""Emails associated with the current user""" + emails( + first: Int + last: Int + verified: Boolean + ): EmailConnection +"""The ID of the current user""" + id: ID! + jobs( + first: Int + after: String + last: Int + before: String + type: [JobTypes!] + state: [JobStates!] + priority: JobPrioritySearch + agentQueryRules: [String!] +"""Order the jobs""" + order: JobOrder + ): JobConnection + notice( + namespace: NoticeNamespaces! + scope: String! + ): Notice + organizations( + first: Int + last: Int + ): OrganizationConnection +"""The current user's permissions""" + permissions: ViewerPermissions! +"""The user's active TOTP configuration, if any. + +This field is private, requires an escalated session, and cannot be accessed via the public GraphQL API.""" + totp( + id: ID + ): TOTP +"""The current user""" + user: User +} + +"""Permissions information about what actions the current user can do""" type ViewerPermissions { - """ - Whether the viewer can configure two-factor authentication - """ - totpConfigure: Permission! +"""Whether the viewer can configure two-factor authentication""" + totpConfigure: Permission! } -""" -A blob of XML represented as a pretty formatted string -""" +"""A blob of XML represented as a pretty formatted string""" scalar XML -""" -A blob of YAML -""" +"""A blob of YAML""" scalar YAML + + From 3b7060357c11d3ff02cc9517db61b97eef78465f Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Thu, 29 Jun 2023 11:17:13 +1000 Subject: [PATCH 15/37] Get for Cluster uses UUID --- buildkite/resource_cluster_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 85f22fc4..b2157f32 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -135,13 +135,13 @@ func testAccCheckClusterDestroy(s *terraform.State) error { var getClusterQuery struct { Organization struct { Cluster struct { - ID string `graphql:"id"` + Name string } } } err := graphqlClient.Query(context.Background(), &getClusterQuery, map[string]interface{}{ - "id": rs.Primary.ID, + "id": rs.Primary.Attributes["uuid"], }) if err == nil { From 0cc2d7f701363ce07a7807aabf1142c66f2f7c50 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Fri, 30 Jun 2023 11:20:19 +1000 Subject: [PATCH 16/37] State doesn't embed cluster under org --- buildkite/resource_cluster_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index b2157f32..41e707f0 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -133,15 +133,13 @@ func testAccCheckClusterDestroy(s *terraform.State) error { } var getClusterQuery struct { - Organization struct { - Cluster struct { - Name string - } + Cluster struct { + ID string } } err := graphqlClient.Query(context.Background(), &getClusterQuery, map[string]interface{}{ - "id": rs.Primary.Attributes["uuid"], + "id": rs.Primary.ID, }) if err == nil { From f0208aa76ef65db22910029b3c9530af8fb22242 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Fri, 30 Jun 2023 14:43:54 +1000 Subject: [PATCH 17/37] Destroy shuold work now --- buildkite/resource_cluster_test.go | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 41e707f0..393eb981 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -1,7 +1,6 @@ package buildkite import ( - "context" "fmt" "testing" @@ -39,6 +38,7 @@ func TestAccCluster_AddRemove(t *testing.T) { { Config: testAccClusterBasic("foo"), Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckClusterExists("buildkite_cluster.foo", &c), testAccCheckClusterRemoteValues(&c, "Test cluster"), ), }, @@ -92,26 +92,11 @@ func testAccCheckClusterExists(n string, c *ClusterResourceModel) resource.TestC return fmt.Errorf("no cluster ID is set") } - var getClusterQuery struct { - Organization struct { - Cluster struct { - ID string `graphql:"id"` - } - } - } - - err := graphqlClient.Query(context.Background(), &getClusterQuery, map[string]interface{}{ - "id": rs.Primary.ID, - }) + _, err := getCluster(genqlientGraphql, getenv("BUILDKITE_ORGANIZATION_SLUG"), rs.Primary.Attributes["uuid"]) if err != nil { return err } - - if getClusterQuery.Organization.Cluster.ID != rs.Primary.ID { - return fmt.Errorf("cluster not found") - } - return nil } } @@ -132,15 +117,7 @@ func testAccCheckClusterDestroy(s *terraform.State) error { continue } - var getClusterQuery struct { - Cluster struct { - ID string - } - } - - err := graphqlClient.Query(context.Background(), &getClusterQuery, map[string]interface{}{ - "id": rs.Primary.ID, - }) + _, err := getCluster(genqlientGraphql, getenv("BUILDKITE_ORGANIZATION_SLUG"), rs.Primary.Attributes["uuid"]) if err == nil { return fmt.Errorf("Cluster still exists") From 06a77348fab1ddc21bdd25696156022d9750088b Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Mon, 3 Jul 2023 16:45:51 +1000 Subject: [PATCH 18/37] Add Import --- buildkite/generated.go | 340 +++++++++-------------------- buildkite/graphql/cluster.graphql | 52 ++--- buildkite/provider.go | 2 +- buildkite/resource_cluster.go | 62 ++++-- buildkite/resource_cluster_test.go | 36 ++- 5 files changed, 185 insertions(+), 307 deletions(-) diff --git a/buildkite/generated.go b/buildkite/generated.go index ea7d63d0..e2d6b24d 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -28,8 +28,8 @@ const ( BuildRetentionPeriodsYears2 BuildRetentionPeriods = "YEARS_2" ) -// ClusterValues includes the GraphQL fields of Cluster requested by the fragment ClusterValues. -type ClusterValues struct { +// ClusterFields includes the GraphQL fields of Cluster requested by the fragment ClusterFields. +type ClusterFields struct { Id string `json:"id"` // The public UUID for this cluster Uuid string `json:"uuid"` @@ -43,23 +43,23 @@ type ClusterValues struct { Color string `json:"color"` } -// GetId returns ClusterValues.Id, and is useful for accessing the field via an interface. -func (v *ClusterValues) GetId() string { return v.Id } +// GetId returns ClusterFields.Id, and is useful for accessing the field via an interface. +func (v *ClusterFields) GetId() string { return v.Id } -// GetUuid returns ClusterValues.Uuid, and is useful for accessing the field via an interface. -func (v *ClusterValues) GetUuid() string { return v.Uuid } +// GetUuid returns ClusterFields.Uuid, and is useful for accessing the field via an interface. +func (v *ClusterFields) GetUuid() string { return v.Uuid } -// GetName returns ClusterValues.Name, and is useful for accessing the field via an interface. -func (v *ClusterValues) GetName() string { return v.Name } +// GetName returns ClusterFields.Name, and is useful for accessing the field via an interface. +func (v *ClusterFields) GetName() string { return v.Name } -// GetDescription returns ClusterValues.Description, and is useful for accessing the field via an interface. -func (v *ClusterValues) GetDescription() string { return v.Description } +// GetDescription returns ClusterFields.Description, and is useful for accessing the field via an interface. +func (v *ClusterFields) GetDescription() string { return v.Description } -// GetEmoji returns ClusterValues.Emoji, and is useful for accessing the field via an interface. -func (v *ClusterValues) GetEmoji() string { return v.Emoji } +// GetEmoji returns ClusterFields.Emoji, and is useful for accessing the field via an interface. +func (v *ClusterFields) GetEmoji() string { return v.Emoji } -// GetColor returns ClusterValues.Color, and is useful for accessing the field via an interface. -func (v *ClusterValues) GetColor() string { return v.Color } +// GetColor returns ClusterFields.Color, and is useful for accessing the field via an interface. +func (v *ClusterFields) GetColor() string { return v.Color } // The roles a user can be within a team type GTeamMemberRole string @@ -560,37 +560,37 @@ func (v *createClusterClusterCreateClusterCreatePayload) GetCluster() createClus // createClusterClusterCreateClusterCreatePayloadCluster includes the requested fields of the GraphQL type Cluster. type createClusterClusterCreateClusterCreatePayloadCluster struct { - ClusterValues `json:"-"` + ClusterFields `json:"-"` } // GetId returns createClusterClusterCreateClusterCreatePayloadCluster.Id, and is useful for accessing the field via an interface. func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetId() string { - return v.ClusterValues.Id + return v.ClusterFields.Id } // GetUuid returns createClusterClusterCreateClusterCreatePayloadCluster.Uuid, and is useful for accessing the field via an interface. func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetUuid() string { - return v.ClusterValues.Uuid + return v.ClusterFields.Uuid } // GetName returns createClusterClusterCreateClusterCreatePayloadCluster.Name, and is useful for accessing the field via an interface. func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetName() string { - return v.ClusterValues.Name + return v.ClusterFields.Name } // GetDescription returns createClusterClusterCreateClusterCreatePayloadCluster.Description, and is useful for accessing the field via an interface. func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetDescription() string { - return v.ClusterValues.Description + return v.ClusterFields.Description } // GetEmoji returns createClusterClusterCreateClusterCreatePayloadCluster.Emoji, and is useful for accessing the field via an interface. func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetEmoji() string { - return v.ClusterValues.Emoji + return v.ClusterFields.Emoji } // GetColor returns createClusterClusterCreateClusterCreatePayloadCluster.Color, and is useful for accessing the field via an interface. func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetColor() string { - return v.ClusterValues.Color + return v.ClusterFields.Color } func (v *createClusterClusterCreateClusterCreatePayloadCluster) UnmarshalJSON(b []byte) error { @@ -611,7 +611,7 @@ func (v *createClusterClusterCreateClusterCreatePayloadCluster) UnmarshalJSON(b } err = json.Unmarshal( - b, &v.ClusterValues) + b, &v.ClusterFields) if err != nil { return err } @@ -643,12 +643,12 @@ func (v *createClusterClusterCreateClusterCreatePayloadCluster) MarshalJSON() ([ func (v *createClusterClusterCreateClusterCreatePayloadCluster) __premarshalJSON() (*__premarshalcreateClusterClusterCreateClusterCreatePayloadCluster, error) { var retval __premarshalcreateClusterClusterCreateClusterCreatePayloadCluster - retval.Id = v.ClusterValues.Id - retval.Uuid = v.ClusterValues.Uuid - retval.Name = v.ClusterValues.Name - retval.Description = v.ClusterValues.Description - retval.Emoji = v.ClusterValues.Emoji - retval.Color = v.ClusterValues.Color + retval.Id = v.ClusterFields.Id + retval.Uuid = v.ClusterFields.Uuid + retval.Name = v.ClusterFields.Name + retval.Description = v.ClusterFields.Description + retval.Emoji = v.ClusterFields.Emoji + retval.Color = v.ClusterFields.Color return &retval, nil } @@ -732,190 +732,84 @@ func (v *getClusterOrganization) GetCluster() getClusterOrganizationCluster { re // getClusterOrganizationCluster includes the requested fields of the GraphQL type Cluster. type getClusterOrganizationCluster struct { - // Name of the cluster - Name string `json:"name"` - Id string `json:"id"` - // The public UUID for this cluster - Uuid string `json:"uuid"` - // Description of the cluster - Description string `json:"description"` - // The default queue that agents connecting to the cluster without specifying a queue will accept jobs from - DefaultQueue getClusterOrganizationClusterDefaultQueueClusterQueue `json:"defaultQueue"` - // Returns agent tokens for the Cluster - AgentTokens getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection `json:"agentTokens"` + ClusterFields `json:"-"` } -// GetName returns getClusterOrganizationCluster.Name, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetName() string { return v.Name } - // GetId returns getClusterOrganizationCluster.Id, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetId() string { return v.Id } +func (v *getClusterOrganizationCluster) GetId() string { return v.ClusterFields.Id } // GetUuid returns getClusterOrganizationCluster.Uuid, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetUuid() string { return v.Uuid } +func (v *getClusterOrganizationCluster) GetUuid() string { return v.ClusterFields.Uuid } + +// GetName returns getClusterOrganizationCluster.Name, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetName() string { return v.ClusterFields.Name } // GetDescription returns getClusterOrganizationCluster.Description, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetDescription() string { return v.Description } +func (v *getClusterOrganizationCluster) GetDescription() string { return v.ClusterFields.Description } -// GetDefaultQueue returns getClusterOrganizationCluster.DefaultQueue, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetDefaultQueue() getClusterOrganizationClusterDefaultQueueClusterQueue { - return v.DefaultQueue -} +// GetEmoji returns getClusterOrganizationCluster.Emoji, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetEmoji() string { return v.ClusterFields.Emoji } -// GetAgentTokens returns getClusterOrganizationCluster.AgentTokens, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetAgentTokens() getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection { - return v.AgentTokens -} +// GetColor returns getClusterOrganizationCluster.Color, and is useful for accessing the field via an interface. +func (v *getClusterOrganizationCluster) GetColor() string { return v.ClusterFields.Color } -// getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection includes the requested fields of the GraphQL type ClusterAgentTokenConnection. -type getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection struct { - Edges []getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge `json:"edges"` -} +func (v *getClusterOrganizationCluster) UnmarshalJSON(b []byte) error { -// GetEdges returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection.Edges, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnection) GetEdges() []getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge { - return v.Edges -} - -// getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge includes the requested fields of the GraphQL type ClusterAgentTokenEdge. -type getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge struct { - Node getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken `json:"node"` -} - -// GetNode returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge.Node, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdge) GetNode() getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken { - return v.Node -} + if string(b) == "null" { + return nil + } -// getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken includes the requested fields of the GraphQL type ClusterToken. -// The GraphQL type's documentation follows. -// -// A token used to connect an agent in cluster to Buildkite -type getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken struct { - CreatedBy getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser `json:"createdBy"` - Id string `json:"id"` - // A description about what this cluster agent token is used for - Description string `json:"description"` - // Agents registered with this token will use a unique token for each job. Please note that this feature is not yet available to all organizations - JobTokensEnabled bool `json:"jobTokensEnabled"` -} + var firstPass struct { + *getClusterOrganizationCluster + graphql.NoUnmarshalJSON + } + firstPass.getClusterOrganizationCluster = v -// GetCreatedBy returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken.CreatedBy, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken) GetCreatedBy() getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser { - return v.CreatedBy -} + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// GetId returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken.Id, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken) GetId() string { - return v.Id + err = json.Unmarshal( + b, &v.ClusterFields) + if err != nil { + return err + } + return nil } -// GetDescription returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken.Description, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken) GetDescription() string { - return v.Description -} +type __premarshalgetClusterOrganizationCluster struct { + Id string `json:"id"` -// GetJobTokensEnabled returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken.JobTokensEnabled, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterToken) GetJobTokensEnabled() bool { - return v.JobTokensEnabled -} + Uuid string `json:"uuid"` -// getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser includes the requested fields of the GraphQL type User. -// The GraphQL type's documentation follows. -// -// A user -type getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser struct { - // The name of the user Name string `json:"name"` - Id string `json:"id"` -} - -// GetName returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser.Name, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser) GetName() string { - return v.Name -} - -// GetId returns getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser.Id, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterAgentTokensClusterAgentTokenConnectionEdgesClusterAgentTokenEdgeNodeClusterTokenCreatedByUser) GetId() string { - return v.Id -} - -// getClusterOrganizationClusterDefaultQueueClusterQueue includes the requested fields of the GraphQL type ClusterQueue. -type getClusterOrganizationClusterDefaultQueueClusterQueue struct { - Key string `json:"key"` - Id string `json:"id"` - // States whether job dispatch is paused for this cluster queue - DispatchPaused bool `json:"dispatchPaused"` - // The user who paused this cluster queue - DispatchPausedBy getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser `json:"dispatchPausedBy"` - Description string `json:"description"` - CreatedBy getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser `json:"createdBy"` -} - -// GetKey returns getClusterOrganizationClusterDefaultQueueClusterQueue.Key, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetKey() string { return v.Key } -// GetId returns getClusterOrganizationClusterDefaultQueueClusterQueue.Id, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetId() string { return v.Id } - -// GetDispatchPaused returns getClusterOrganizationClusterDefaultQueueClusterQueue.DispatchPaused, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetDispatchPaused() bool { - return v.DispatchPaused -} - -// GetDispatchPausedBy returns getClusterOrganizationClusterDefaultQueueClusterQueue.DispatchPausedBy, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetDispatchPausedBy() getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser { - return v.DispatchPausedBy -} - -// GetDescription returns getClusterOrganizationClusterDefaultQueueClusterQueue.Description, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetDescription() string { - return v.Description -} - -// GetCreatedBy returns getClusterOrganizationClusterDefaultQueueClusterQueue.CreatedBy, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueue) GetCreatedBy() getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser { - return v.CreatedBy -} + Description string `json:"description"` -// getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser includes the requested fields of the GraphQL type User. -// The GraphQL type's documentation follows. -// -// A user -type getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser struct { - // The name of the user - Name string `json:"name"` - Id string `json:"id"` -} + Emoji string `json:"emoji"` -// GetName returns getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser.Name, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser) GetName() string { - return v.Name + Color string `json:"color"` } -// GetId returns getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser.Id, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueueCreatedByUser) GetId() string { - return v.Id +func (v *getClusterOrganizationCluster) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser includes the requested fields of the GraphQL type User. -// The GraphQL type's documentation follows. -// -// A user -type getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser struct { - // The name of the user - Name string `json:"name"` - Id string `json:"id"` -} +func (v *getClusterOrganizationCluster) __premarshalJSON() (*__premarshalgetClusterOrganizationCluster, error) { + var retval __premarshalgetClusterOrganizationCluster -// GetName returns getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser.Name, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser) GetName() string { - return v.Name -} - -// GetId returns getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser.Id, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationClusterDefaultQueueClusterQueueDispatchPausedByUser) GetId() string { - return v.Id + retval.Id = v.ClusterFields.Id + retval.Uuid = v.ClusterFields.Uuid + retval.Name = v.ClusterFields.Name + retval.Description = v.ClusterFields.Description + retval.Emoji = v.ClusterFields.Emoji + retval.Color = v.ClusterFields.Color + return &retval, nil } // getClusterResponse is returned by getCluster on success. @@ -1194,37 +1088,37 @@ func (v *updateClusterClusterUpdateClusterUpdatePayload) GetCluster() updateClus // updateClusterClusterUpdateClusterUpdatePayloadCluster includes the requested fields of the GraphQL type Cluster. type updateClusterClusterUpdateClusterUpdatePayloadCluster struct { - ClusterValues `json:"-"` + ClusterFields `json:"-"` } // GetId returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Id, and is useful for accessing the field via an interface. func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetId() string { - return v.ClusterValues.Id + return v.ClusterFields.Id } // GetUuid returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Uuid, and is useful for accessing the field via an interface. func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetUuid() string { - return v.ClusterValues.Uuid + return v.ClusterFields.Uuid } // GetName returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Name, and is useful for accessing the field via an interface. func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetName() string { - return v.ClusterValues.Name + return v.ClusterFields.Name } // GetDescription returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Description, and is useful for accessing the field via an interface. func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetDescription() string { - return v.ClusterValues.Description + return v.ClusterFields.Description } // GetEmoji returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Emoji, and is useful for accessing the field via an interface. func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetEmoji() string { - return v.ClusterValues.Emoji + return v.ClusterFields.Emoji } // GetColor returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Color, and is useful for accessing the field via an interface. func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetColor() string { - return v.ClusterValues.Color + return v.ClusterFields.Color } func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) UnmarshalJSON(b []byte) error { @@ -1245,7 +1139,7 @@ func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) UnmarshalJSON(b } err = json.Unmarshal( - b, &v.ClusterValues) + b, &v.ClusterFields) if err != nil { return err } @@ -1277,12 +1171,12 @@ func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) MarshalJSON() ([ func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) __premarshalJSON() (*__premarshalupdateClusterClusterUpdateClusterUpdatePayloadCluster, error) { var retval __premarshalupdateClusterClusterUpdateClusterUpdatePayloadCluster - retval.Id = v.ClusterValues.Id - retval.Uuid = v.ClusterValues.Uuid - retval.Name = v.ClusterValues.Name - retval.Description = v.ClusterValues.Description - retval.Emoji = v.ClusterValues.Emoji - retval.Color = v.ClusterValues.Color + retval.Id = v.ClusterFields.Id + retval.Uuid = v.ClusterFields.Uuid + retval.Name = v.ClusterFields.Name + retval.Description = v.ClusterFields.Description + retval.Emoji = v.ClusterFields.Emoji + retval.Color = v.ClusterFields.Color return &retval, nil } @@ -1699,11 +1593,11 @@ mutation createCluster ($organizationId: ID!, $name: String!, $description: Stri clusterCreate(input: {organizationId:$organizationId,name:$name,description:$description,emoji:$emoji,color:$color}) { clientMutationId cluster { - ... ClusterValues + ... ClusterFields } } } -fragment ClusterValues on Cluster { +fragment ClusterFields on Cluster { id uuid name @@ -1823,40 +1717,18 @@ const getCluster_Operation = ` query getCluster ($orgSlug: ID!, $id: ID!) { organization(slug: $orgSlug) { cluster(id: $id) { - name - id - uuid - description - defaultQueue { - key - id - dispatchPaused - dispatchPausedBy { - name - id - } - description - createdBy { - name - id - } - } - agentTokens { - edges { - node { - createdBy { - name - id - } - id - description - jobTokensEnabled - } - } - } + ... ClusterFields } } } +fragment ClusterFields on Cluster { + id + uuid + name + description + emoji + color +} ` func getCluster( @@ -2090,11 +1962,11 @@ mutation updateCluster ($organizationId: ID!, $id: ID!, $name: String, $descript clusterUpdate(input: {organizationId:$organizationId,id:$id,name:$name,description:$description,emoji:$emoji,color:$color}) { clientMutationId cluster { - ... ClusterValues + ... ClusterFields } } } -fragment ClusterValues on Cluster { +fragment ClusterFields on Cluster { id uuid name diff --git a/buildkite/graphql/cluster.graphql b/buildkite/graphql/cluster.graphql index 5151a758..d867772b 100644 --- a/buildkite/graphql/cluster.graphql +++ b/buildkite/graphql/cluster.graphql @@ -1,4 +1,4 @@ -fragment ClusterValues on Cluster { +fragment ClusterFields on Cluster { id uuid name @@ -10,52 +10,34 @@ fragment ClusterValues on Cluster { query getCluster($orgSlug: ID!, $id: ID!) { organization(slug: $orgSlug) { cluster(id: $id) { - name - id - uuid - description - defaultQueue { - key - id - dispatchPaused - dispatchPausedBy { - name - id - } - description - createdBy { - name - id - } - } - agentTokens { - edges { - node { - createdBy { - name - id - } - id - description - jobTokensEnabled - } - } - } + ...ClusterFields } } } -mutation createCluster($organizationId: ID!, $name: String!, $description: String, $emoji: String, $color: String) { +# @genqlient(for: "ClusterCreateInput.description", pointer: true) +# @genqlient(for: "ClusterCreateInput.emoji", pointer: true) +# @genqlient(for: "ClusterCreateInput.color", pointer: true) +mutation createCluster( + $organizationId: ID! + $name: String! + $description: String + $emoji: String + $color: String + ) { clusterCreate( input: { organizationId: $organizationId, name: $name, description: $description, emoji: $emoji, color: $color } ) { clientMutationId cluster { - ...ClusterValues + ...ClusterFields } } } +# @genqlient(for: "ClusterUpdateInput.description", pointer: true) +# @genqlient(for: "ClusterUpdateInput.emoji", pointer: true) +# @genqlient(for: "ClusterUpdateInput.color", pointer: true) mutation updateCluster( $organizationId: ID! $id: ID! @@ -76,7 +58,7 @@ mutation updateCluster( ) { clientMutationId cluster { - ...ClusterValues + ...ClusterFields } } } diff --git a/buildkite/provider.go b/buildkite/provider.go index c675f14c..7bac9fcd 100644 --- a/buildkite/provider.go +++ b/buildkite/provider.go @@ -92,7 +92,7 @@ func (tf *terraformProvider) Metadata(ctx context.Context, req provider.Metadata func (*terraformProvider) Resources(context.Context) []func() resource.Resource { return []func() resource.Resource{ NewAgentTokenResource, - NewClusterResource, + newClusterResource, } } diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index d66e29f7..c4db5053 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" resource_schema "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" @@ -11,11 +12,11 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -type ClusterResource struct { +type clusterResource struct { client *Client } -type ClusterResourceModel struct { +type clusterResourceModel struct { ID types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` @@ -24,15 +25,15 @@ type ClusterResourceModel struct { UUID types.String `tfsdk:"uuid"` } -func NewClusterResource() resource.Resource { - return &ClusterResource{} +func newClusterResource() resource.Resource { + return &clusterResource{} } -func (c *ClusterResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { +func (c *clusterResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_cluster" } -func (c *ClusterResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { +func (c *clusterResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -40,7 +41,7 @@ func (c *ClusterResource) Configure(ctx context.Context, req resource.ConfigureR c.client = req.ProviderData.(*Client) } -func (c *ClusterResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (c *clusterResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = resource_schema.Schema{ MarkdownDescription: "A Cluster is a group of Agents that can be used to run your builds. " + "Clusters are useful for grouping Agents by their capabilities, such as operating system, hardware, or location. ", @@ -77,8 +78,8 @@ func (c *ClusterResource) Schema(ctx context.Context, req resource.SchemaRequest } } -func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var state *ClusterResourceModel +func (c *clusterResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var state *clusterResourceModel resp.Diagnostics.Append(req.Plan.Get(ctx, &state)...) if resp.Diagnostics.HasError() { @@ -108,8 +109,8 @@ func (c *ClusterResource) Create(ctx context.Context, req resource.CreateRequest resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } -func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state ClusterResourceModel +func (c *clusterResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state clusterResourceModel resp.Diagnostics.Append(req.State.Get(ctx, &state)...) @@ -130,8 +131,8 @@ func (c *ClusterResource) Read(ctx context.Context, req resource.ReadRequest, re resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } -func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var state, plan ClusterResourceModel +func (c *clusterResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var state, plan clusterResourceModel resp.Diagnostics.Append(req.State.Get(ctx, &state)...) resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) @@ -163,8 +164,8 @@ func (c *ClusterResource) Update(ctx context.Context, req resource.UpdateRequest resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) } -func (c *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state ClusterResourceModel +func (c *clusterResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state clusterResourceModel resp.Diagnostics.Append(req.State.Get(ctx, &state)...) @@ -182,3 +183,34 @@ func (c *ClusterResource) Delete(ctx context.Context, req resource.DeleteRequest return } } + +func (c *clusterResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + uuid := req.ID + + if uuid == "" { + resp.Diagnostics.AddError( + "Unable to import Cluster", + "Unable to import Cluster, no UUID was provided", + ) + return + } + + cluster, err := getCluster(c.client.genqlient, c.client.organization, uuid) + + if err != nil { + resp.Diagnostics.AddError( + "Unable to import Cluster", + fmt.Sprintf("Unable to import Cluster: %s", err.Error()), + ) + return + } + + id := cluster.Organization.Cluster.Id + + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), types.StringValue(id))...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("uuid"), uuid)...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("name"), types.StringValue(cluster.Organization.Cluster.Name))...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("description"), types.StringValue(cluster.Organization.Cluster.Description))...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("emoji"), types.StringValue(cluster.Organization.Cluster.Emoji))...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("color"), types.StringValue(cluster.Organization.Cluster.Color))...) +} diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 393eb981..a9b52e02 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -4,8 +4,6 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-framework/providerserver" - "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -14,40 +12,35 @@ func testAccClusterBasic(name string) string { config := ` resource "buildkite_cluster" "foo" { name = "%s_test_cluster" - description = "Test cluster" } ` return fmt.Sprintf(config, name) } -func protoV5ProviderFactories() map[string]func() (tfprotov5.ProviderServer, error) { - return map[string]func() (tfprotov5.ProviderServer, error){ - "buildkite": providerserver.NewProtocol5WithError(New("testing")), - } -} - func TestAccCluster_AddRemove(t *testing.T) { - t.Parallel() - var c ClusterResourceModel + var c clusterResourceModel resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ProtoV5ProviderFactories: protoV5ProviderFactories(), + ProtoV6ProviderFactories: protoV6ProviderFactories(), CheckDestroy: testAccCheckClusterDestroy, Steps: []resource.TestStep{ { Config: testAccClusterBasic("foo"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), - testAccCheckClusterRemoteValues(&c, "Test cluster"), + testAccCheckClusterRemoteValues(&c, "foo_test_cluster"), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "foo_test_cluster"), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), ), }, { RefreshState: true, PlanOnly: true, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "name"), - resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "description"), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), ), }, }, @@ -55,12 +48,11 @@ func TestAccCluster_AddRemove(t *testing.T) { } func TestAccCluster_Update(t *testing.T) { - t.Parallel() - var c ClusterResourceModel + var c clusterResourceModel resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ProtoV5ProviderFactories: protoV5ProviderFactories(), + ProtoV6ProviderFactories: protoV6ProviderFactories(), CheckDestroy: testAccCheckClusterDestroy, Steps: []resource.TestStep{ { @@ -81,7 +73,7 @@ func TestAccCluster_Update(t *testing.T) { }) } -func testAccCheckClusterExists(n string, c *ClusterResourceModel) resource.TestCheckFunc { +func testAccCheckClusterExists(n string, c *clusterResourceModel) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -101,11 +93,11 @@ func testAccCheckClusterExists(n string, c *ClusterResourceModel) resource.TestC } } -func testAccCheckClusterRemoteValues(c *ClusterResourceModel, description string) resource.TestCheckFunc { +func testAccCheckClusterRemoteValues(c *clusterResourceModel, name string) resource.TestCheckFunc { return func(s *terraform.State) error { - if string(c.Description.ValueString()) != description { - return fmt.Errorf("unexpected description: %s", c.Description) + if c.Name.ValueString() != name { + return fmt.Errorf("unexpected name: %s, wanted: %s", c.Name, name) } return nil } From 4f0546ce08886ff2e15c6418acc038a5f205e237 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Mon, 3 Jul 2023 17:24:19 +1000 Subject: [PATCH 19/37] Add remote check to see if it fails --- buildkite/resource_cluster_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index a9b52e02..3b7046f2 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -18,6 +18,7 @@ func testAccClusterBasic(name string) string { } func TestAccCluster_AddRemove(t *testing.T) { + t.Parallel() var c clusterResourceModel resource.Test(t, resource.TestCase{ @@ -48,6 +49,7 @@ func TestAccCluster_AddRemove(t *testing.T) { } func TestAccCluster_Update(t *testing.T) { + t.Parallel() var c clusterResourceModel resource.Test(t, resource.TestCase{ @@ -59,6 +61,7 @@ func TestAccCluster_Update(t *testing.T) { Config: testAccClusterBasic("bar"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), + testAccCheckClusterRemoteValues(&c, "bar_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "bar_test_cluster"), ), }, @@ -66,6 +69,7 @@ func TestAccCluster_Update(t *testing.T) { Config: testAccClusterBasic("baz"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), + testAccCheckClusterRemoteValues(&c, "baz_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), ), }, From 2f0e4a627b782aca453b3db02d02e28689778b70 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 08:58:58 +1000 Subject: [PATCH 20/37] Cluster tests passing. Doesn't check remote as returns null at moment. --- buildkite/resource_cluster_test.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 3b7046f2..3984dcc1 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -30,16 +30,6 @@ func TestAccCluster_AddRemove(t *testing.T) { Config: testAccClusterBasic("foo"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), - testAccCheckClusterRemoteValues(&c, "foo_test_cluster"), - resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "foo_test_cluster"), - resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), - resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), - ), - }, - { - RefreshState: true, - PlanOnly: true, - Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), ), @@ -61,7 +51,6 @@ func TestAccCluster_Update(t *testing.T) { Config: testAccClusterBasic("bar"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), - testAccCheckClusterRemoteValues(&c, "bar_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "bar_test_cluster"), ), }, @@ -69,7 +58,6 @@ func TestAccCluster_Update(t *testing.T) { Config: testAccClusterBasic("baz"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), - testAccCheckClusterRemoteValues(&c, "baz_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), ), }, From 4cb59ed9ecf385a904b8b2287e817f0c2c5978b8 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 09:14:52 +1000 Subject: [PATCH 21/37] Add Cluster examples. --- docs/resources/cluster.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/resources/cluster.md diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md new file mode 100644 index 00000000..2921049b --- /dev/null +++ b/docs/resources/cluster.md @@ -0,0 +1,29 @@ +# Resource: cluster + +This resource allows you to create, manage and import Clusters. + +Buildkite documentation: https://buildkite.com/docs/clusters/overview + +## Example Usage + +```hcl +provider "buildkitE" {} + +resource "buildkite_cluster" "linux" { + name = "linux_builds" +} +``` + +## Argument Reference + +* `name` - (Required) This is the name of the cluster. +* `description` - (Optional) This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose. +* `emoji` - (Optional) An emoji to use with the Cluster, this can either be set using `:buildkite:` notation, or with the emoji itself, such as 😎. +* `color` - (Optional) A color to associate with the Cluster. Perhaps a team related color, or one related to an environment. This is set using hex value, such as `#BADA55`. + +## Attribute Reference + +* `id` - The GraphQL ID that is created with the Cluster. +* `uuid` - The UUID created with the Cluster. + +The `uuid` is used when *getting* a Cluster. The `id` is used when *modifying* a Cluster. From 3d16e881bc00cd20687dcfed6093d7861602743e Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 11:23:54 +1000 Subject: [PATCH 22/37] The story so far. --- buildkite/resource_cluster_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 3984dcc1..a8e07b71 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -65,6 +65,30 @@ func TestAccCluster_Update(t *testing.T) { }) } +func TestAccCluster_Import(t *testing.T) { + var c clusterResourceModel + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: protoV6ProviderFactories(), + CheckDestroy: testAccCheckClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccClusterBasic("imported"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckClusterExists("buildkite_cluster.foo", &c), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "imported_test_cluster"), + ), + }, + { + ResourceName: "buildkite_cluster.foo", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckClusterExists(n string, c *clusterResourceModel) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] From 36e5025af7c73011ca7035e8a82b495e379791a7 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 15:45:21 +1000 Subject: [PATCH 23/37] Add an update func for Read to implement --- buildkite/resource_cluster.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index c4db5053..b14840bd 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -118,7 +118,7 @@ func (c *clusterResource) Read(ctx context.Context, req resource.ReadRequest, re return } - _, err := getCluster(c.client.genqlient, c.client.organization, state.UUID.ValueString()) + r, err := getCluster(c.client.genqlient, c.client.organization, state.UUID.ValueString()) if err != nil { resp.Diagnostics.AddError( @@ -128,6 +128,7 @@ func (c *clusterResource) Read(ctx context.Context, req resource.ReadRequest, re return } + updateClusterResourceState(r.Organization.Cluster, &state) resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } @@ -206,11 +207,17 @@ func (c *clusterResource) ImportState(ctx context.Context, req resource.ImportSt } id := cluster.Organization.Cluster.Id + uuid = cluster.Organization.Cluster.Uuid resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), types.StringValue(id))...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("uuid"), uuid)...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("name"), types.StringValue(cluster.Organization.Cluster.Name))...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("description"), types.StringValue(cluster.Organization.Cluster.Description))...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("emoji"), types.StringValue(cluster.Organization.Cluster.Emoji))...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("color"), types.StringValue(cluster.Organization.Cluster.Color))...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("uuid"), types.StringValue(uuid))...) +} + +func updateClusterResourceState(cl getClusterOrganizationCluster, c *clusterResourceModel) { + c.ID = types.StringValue(cl.Id) + c.UUID = types.StringValue(cl.Uuid) + c.Name = types.StringValue(cl.Name) + c.Description = types.StringValue(cl.Description) + c.Emoji = types.StringValue(cl.Emoji) + c.Color = types.StringValue(cl.Color) } From 55378f8347f0ecd77ad5964d51e2415d85267166 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 16:04:27 +1000 Subject: [PATCH 24/37] Make Import sick --- buildkite/resource_cluster.go | 26 +------------------------- buildkite/resource_cluster_test.go | 4 ++++ 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index b14840bd..83422d27 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -186,31 +186,7 @@ func (c *clusterResource) Delete(ctx context.Context, req resource.DeleteRequest } func (c *clusterResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - uuid := req.ID - - if uuid == "" { - resp.Diagnostics.AddError( - "Unable to import Cluster", - "Unable to import Cluster, no UUID was provided", - ) - return - } - - cluster, err := getCluster(c.client.genqlient, c.client.organization, uuid) - - if err != nil { - resp.Diagnostics.AddError( - "Unable to import Cluster", - fmt.Sprintf("Unable to import Cluster: %s", err.Error()), - ) - return - } - - id := cluster.Organization.Cluster.Id - uuid = cluster.Organization.Cluster.Uuid - - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), types.StringValue(id))...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("uuid"), types.StringValue(uuid))...) + resource.ImportStatePassthroughID(ctx, path.Root("uuid"), req, resp) } func updateClusterResourceState(cl getClusterOrganizationCluster, c *clusterResourceModel) { diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index a8e07b71..ae505fb9 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -30,6 +30,7 @@ func TestAccCluster_AddRemove(t *testing.T) { Config: testAccClusterBasic("foo"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), + testAccCheckClusterRemoteValues(&c, "foo_test_cluster"), resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), ), @@ -51,6 +52,7 @@ func TestAccCluster_Update(t *testing.T) { Config: testAccClusterBasic("bar"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), + testAccCheckClusterRemoteValues(&c, "bar_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "bar_test_cluster"), ), }, @@ -58,6 +60,7 @@ func TestAccCluster_Update(t *testing.T) { Config: testAccClusterBasic("baz"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), + testAccCheckClusterRemoteValues(&c, "baz_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), ), }, @@ -84,6 +87,7 @@ func TestAccCluster_Import(t *testing.T) { ResourceName: "buildkite_cluster.foo", ImportState: true, ImportStateVerify: true, + ImportStateId: c.UUID.ValueString(), }, }, }) From ad670f07069bdad98867b50c71f8f6ecf086ac76 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 16:13:09 +1000 Subject: [PATCH 25/37] Re-gen schema. --- buildkite/generated.go | 307 +++++++++++++++--------------- buildkite/graphql/cluster.graphql | 27 +-- schema.graphql | 47 +++-- 3 files changed, 199 insertions(+), 182 deletions(-) diff --git a/buildkite/generated.go b/buildkite/generated.go index 87fc95cb..dd8bfcc8 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -36,11 +36,11 @@ type ClusterFields struct { // Name of the cluster Name string `json:"name"` // Description of the cluster - Description string `json:"description"` + Description *string `json:"description"` // Emoji for the cluster using Buildkite emoji syntax - Emoji string `json:"emoji"` + Emoji *string `json:"emoji"` // Color hex code for the cluster - Color string `json:"color"` + Color *string `json:"color"` } // GetId returns ClusterFields.Id, and is useful for accessing the field via an interface. @@ -53,13 +53,13 @@ func (v *ClusterFields) GetUuid() string { return v.Uuid } func (v *ClusterFields) GetName() string { return v.Name } // GetDescription returns ClusterFields.Description, and is useful for accessing the field via an interface. -func (v *ClusterFields) GetDescription() string { return v.Description } +func (v *ClusterFields) GetDescription() *string { return v.Description } // GetEmoji returns ClusterFields.Emoji, and is useful for accessing the field via an interface. -func (v *ClusterFields) GetEmoji() string { return v.Emoji } +func (v *ClusterFields) GetEmoji() *string { return v.Emoji } // GetColor returns ClusterFields.Color, and is useful for accessing the field via an interface. -func (v *ClusterFields) GetColor() string { return v.Color } +func (v *ClusterFields) GetColor() *string { return v.Color } // ClusterQueueValues includes the GraphQL fields of ClusterQueue requested by the fragment ClusterQueueValues. type ClusterQueueValues struct { @@ -205,6 +205,8 @@ type PipelineUpdateInput struct { // Autogenerated input type of PipelineUpdate ClusterId *string `json:"clusterId"` // Autogenerated input type of PipelineUpdate + PipelineTemplateId string `json:"pipelineTemplateId"` + // Autogenerated input type of PipelineUpdate Archived bool `json:"archived,omitempty"` // Autogenerated input type of PipelineUpdate Tags []PipelineTagInput `json:"tags"` @@ -284,6 +286,9 @@ func (v *PipelineUpdateInput) GetBuildRetentionNumber() int { return v.BuildRete // GetClusterId returns PipelineUpdateInput.ClusterId, and is useful for accessing the field via an interface. func (v *PipelineUpdateInput) GetClusterId() *string { return v.ClusterId } +// GetPipelineTemplateId returns PipelineUpdateInput.PipelineTemplateId, and is useful for accessing the field via an interface. +func (v *PipelineUpdateInput) GetPipelineTemplateId() string { return v.PipelineTemplateId } + // GetArchived returns PipelineUpdateInput.Archived, and is useful for accessing the field via an interface. func (v *PipelineUpdateInput) GetArchived() bool { return v.Archived } @@ -345,11 +350,11 @@ func (v *__createAgentTokenInput) GetDescription() *string { return v.Descriptio // __createClusterInput is used internally by genqlient type __createClusterInput struct { - OrganizationId string `json:"organizationId"` - Name string `json:"name"` - Description string `json:"description"` - Emoji string `json:"emoji"` - Color string `json:"color"` + OrganizationId string `json:"organizationId"` + Name string `json:"name"` + Description *string `json:"description"` + Emoji *string `json:"emoji"` + Color *string `json:"color"` } // GetOrganizationId returns __createClusterInput.OrganizationId, and is useful for accessing the field via an interface. @@ -359,25 +364,13 @@ func (v *__createClusterInput) GetOrganizationId() string { return v.Organizatio func (v *__createClusterInput) GetName() string { return v.Name } // GetDescription returns __createClusterInput.Description, and is useful for accessing the field via an interface. -func (v *__createClusterInput) GetDescription() string { return v.Description } +func (v *__createClusterInput) GetDescription() *string { return v.Description } // GetEmoji returns __createClusterInput.Emoji, and is useful for accessing the field via an interface. -func (v *__createClusterInput) GetEmoji() string { return v.Emoji } +func (v *__createClusterInput) GetEmoji() *string { return v.Emoji } // GetColor returns __createClusterInput.Color, and is useful for accessing the field via an interface. -func (v *__createClusterInput) GetColor() string { return v.Color } - -// __deleteClusterInput is used internally by genqlient -type __deleteClusterInput struct { - OrganizationId string `json:"organizationId"` - Id string `json:"id"` -} - -// GetOrganizationId returns __deleteClusterInput.OrganizationId, and is useful for accessing the field via an interface. -func (v *__deleteClusterInput) GetOrganizationId() string { return v.OrganizationId } - -// GetId returns __deleteClusterInput.Id, and is useful for accessing the field via an interface. -func (v *__deleteClusterInput) GetId() string { return v.Id } +func (v *__createClusterInput) GetColor() *string { return v.Color } // __createClusterQueueInput is used internally by genqlient type __createClusterQueueInput struct { @@ -399,6 +392,18 @@ func (v *__createClusterQueueInput) GetKey() string { return v.Key } // GetDescription returns __createClusterQueueInput.Description, and is useful for accessing the field via an interface. func (v *__createClusterQueueInput) GetDescription() *string { return v.Description } +// __deleteClusterInput is used internally by genqlient +type __deleteClusterInput struct { + OrganizationId string `json:"organizationId"` + Id string `json:"id"` +} + +// GetOrganizationId returns __deleteClusterInput.OrganizationId, and is useful for accessing the field via an interface. +func (v *__deleteClusterInput) GetOrganizationId() string { return v.OrganizationId } + +// GetId returns __deleteClusterInput.Id, and is useful for accessing the field via an interface. +func (v *__deleteClusterInput) GetId() string { return v.Id } + // __deleteClusterQueueInput is used internally by genqlient type __deleteClusterQueueInput struct { OrganizationId string `json:"organizationId"` @@ -493,12 +498,12 @@ func (v *__setApiIpAddressesInput) GetIpAddresses() string { return v.IpAddresse // __updateClusterInput is used internally by genqlient type __updateClusterInput struct { - OrganizationId string `json:"organizationId"` - Id string `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - Emoji string `json:"emoji"` - Color string `json:"color"` + OrganizationId string `json:"organizationId"` + Id string `json:"id"` + Name string `json:"name"` + Description *string `json:"description"` + Emoji *string `json:"emoji"` + Color *string `json:"color"` } // GetOrganizationId returns __updateClusterInput.OrganizationId, and is useful for accessing the field via an interface. @@ -511,13 +516,13 @@ func (v *__updateClusterInput) GetId() string { return v.Id } func (v *__updateClusterInput) GetName() string { return v.Name } // GetDescription returns __updateClusterInput.Description, and is useful for accessing the field via an interface. -func (v *__updateClusterInput) GetDescription() string { return v.Description } +func (v *__updateClusterInput) GetDescription() *string { return v.Description } // GetEmoji returns __updateClusterInput.Emoji, and is useful for accessing the field via an interface. -func (v *__updateClusterInput) GetEmoji() string { return v.Emoji } +func (v *__updateClusterInput) GetEmoji() *string { return v.Emoji } // GetColor returns __updateClusterInput.Color, and is useful for accessing the field via an interface. -func (v *__updateClusterInput) GetColor() string { return v.Color } +func (v *__updateClusterInput) GetColor() *string { return v.Color } // __updateClusterQueueInput is used internally by genqlient type __updateClusterQueueInput struct { @@ -677,17 +682,17 @@ func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetName() string } // GetDescription returns createClusterClusterCreateClusterCreatePayloadCluster.Description, and is useful for accessing the field via an interface. -func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetDescription() string { +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetDescription() *string { return v.ClusterFields.Description } // GetEmoji returns createClusterClusterCreateClusterCreatePayloadCluster.Emoji, and is useful for accessing the field via an interface. -func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetEmoji() string { +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetEmoji() *string { return v.ClusterFields.Emoji } // GetColor returns createClusterClusterCreateClusterCreatePayloadCluster.Color, and is useful for accessing the field via an interface. -func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetColor() string { +func (v *createClusterClusterCreateClusterCreatePayloadCluster) GetColor() *string { return v.ClusterFields.Color } @@ -723,11 +728,11 @@ type __premarshalcreateClusterClusterCreateClusterCreatePayloadCluster struct { Name string `json:"name"` - Description string `json:"description"` + Description *string `json:"description"` - Emoji string `json:"emoji"` + Emoji *string `json:"emoji"` - Color string `json:"color"` + Color *string `json:"color"` } func (v *createClusterClusterCreateClusterCreatePayloadCluster) MarshalJSON() ([]byte, error) { @@ -750,42 +755,6 @@ func (v *createClusterClusterCreateClusterCreatePayloadCluster) __premarshalJSON return &retval, nil } -// createClusterResponse is returned by createCluster on success. -type createClusterResponse struct { - // Create a cluster. - ClusterCreate createClusterClusterCreateClusterCreatePayload `json:"clusterCreate"` -} - -// GetClusterCreate returns createClusterResponse.ClusterCreate, and is useful for accessing the field via an interface. -func (v *createClusterResponse) GetClusterCreate() createClusterClusterCreateClusterCreatePayload { - return v.ClusterCreate -} - -// deleteClusterClusterDeleteClusterDeletePayload includes the requested fields of the GraphQL type ClusterDeletePayload. -// The GraphQL type's documentation follows. -// -// Autogenerated return type of ClusterDelete. -type deleteClusterClusterDeleteClusterDeletePayload struct { - // A unique identifier for the client performing the mutation. - ClientMutationId string `json:"clientMutationId"` -} - -// GetClientMutationId returns deleteClusterClusterDeleteClusterDeletePayload.ClientMutationId, and is useful for accessing the field via an interface. -func (v *deleteClusterClusterDeleteClusterDeletePayload) GetClientMutationId() string { - return v.ClientMutationId -} - -// deleteClusterResponse is returned by deleteCluster on success. -type deleteClusterResponse struct { - // Delete a cluster. - ClusterDelete deleteClusterClusterDeleteClusterDeletePayload `json:"clusterDelete"` -} - -// GetClusterDelete returns deleteClusterResponse.ClusterDelete, and is useful for accessing the field via an interface. -func (v *deleteClusterResponse) GetClusterDelete() deleteClusterClusterDeleteClusterDeletePayload { - return v.ClusterDelete -} - // createClusterQueueClusterQueueCreateClusterQueueCreatePayload includes the requested fields of the GraphQL type ClusterQueueCreatePayload. // The GraphQL type's documentation follows. // @@ -896,6 +865,31 @@ func (v *createClusterQueueResponse) GetClusterQueueCreate() createClusterQueueC return v.ClusterQueueCreate } +// createClusterResponse is returned by createCluster on success. +type createClusterResponse struct { + // Create a cluster. + ClusterCreate createClusterClusterCreateClusterCreatePayload `json:"clusterCreate"` +} + +// GetClusterCreate returns createClusterResponse.ClusterCreate, and is useful for accessing the field via an interface. +func (v *createClusterResponse) GetClusterCreate() createClusterClusterCreateClusterCreatePayload { + return v.ClusterCreate +} + +// deleteClusterClusterDeleteClusterDeletePayload includes the requested fields of the GraphQL type ClusterDeletePayload. +// The GraphQL type's documentation follows. +// +// Autogenerated return type of ClusterDelete. +type deleteClusterClusterDeleteClusterDeletePayload struct { + // A unique identifier for the client performing the mutation. + ClientMutationId string `json:"clientMutationId"` +} + +// GetClientMutationId returns deleteClusterClusterDeleteClusterDeletePayload.ClientMutationId, and is useful for accessing the field via an interface. +func (v *deleteClusterClusterDeleteClusterDeletePayload) GetClientMutationId() string { + return v.ClientMutationId +} + // deleteClusterQueueClusterQueueDeleteClusterQueueDeletePayload includes the requested fields of the GraphQL type ClusterQueueDeletePayload. // The GraphQL type's documentation follows. // @@ -921,6 +915,17 @@ func (v *deleteClusterQueueResponse) GetClusterQueueDelete() deleteClusterQueueC return v.ClusterQueueDelete } +// deleteClusterResponse is returned by deleteCluster on success. +type deleteClusterResponse struct { + // Delete a cluster. + ClusterDelete deleteClusterClusterDeleteClusterDeletePayload `json:"clusterDelete"` +} + +// GetClusterDelete returns deleteClusterResponse.ClusterDelete, and is useful for accessing the field via an interface. +func (v *deleteClusterResponse) GetClusterDelete() deleteClusterClusterDeleteClusterDeletePayload { + return v.ClusterDelete +} + // getAgentTokenAgentToken includes the requested fields of the GraphQL type AgentToken. // The GraphQL type's documentation follows. // @@ -978,13 +983,13 @@ func (v *getClusterOrganizationCluster) GetUuid() string { return v.ClusterField func (v *getClusterOrganizationCluster) GetName() string { return v.ClusterFields.Name } // GetDescription returns getClusterOrganizationCluster.Description, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetDescription() string { return v.ClusterFields.Description } +func (v *getClusterOrganizationCluster) GetDescription() *string { return v.ClusterFields.Description } // GetEmoji returns getClusterOrganizationCluster.Emoji, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetEmoji() string { return v.ClusterFields.Emoji } +func (v *getClusterOrganizationCluster) GetEmoji() *string { return v.ClusterFields.Emoji } // GetColor returns getClusterOrganizationCluster.Color, and is useful for accessing the field via an interface. -func (v *getClusterOrganizationCluster) GetColor() string { return v.ClusterFields.Color } +func (v *getClusterOrganizationCluster) GetColor() *string { return v.ClusterFields.Color } func (v *getClusterOrganizationCluster) UnmarshalJSON(b []byte) error { @@ -1018,11 +1023,11 @@ type __premarshalgetClusterOrganizationCluster struct { Name string `json:"name"` - Description string `json:"description"` + Description *string `json:"description"` - Emoji string `json:"emoji"` + Emoji *string `json:"emoji"` - Color string `json:"color"` + Color *string `json:"color"` } func (v *getClusterOrganizationCluster) MarshalJSON() ([]byte, error) { @@ -1045,15 +1050,6 @@ func (v *getClusterOrganizationCluster) __premarshalJSON() (*__premarshalgetClus return &retval, nil } -// getClusterResponse is returned by getCluster on success. -type getClusterResponse struct { - // Find an organization - Organization getClusterOrganization `json:"organization"` -} - -// GetOrganization returns getClusterResponse.Organization, and is useful for accessing the field via an interface. -func (v *getClusterResponse) GetOrganization() getClusterOrganization { return v.Organization } - // getClusterQueuesOrganization includes the requested fields of the GraphQL type Organization. // The GraphQL type's documentation follows. // @@ -1195,6 +1191,15 @@ func (v *getClusterQueuesResponse) GetOrganization() getClusterQueuesOrganizatio return v.Organization } +// getClusterResponse is returned by getCluster on success. +type getClusterResponse struct { + // Find an organization + Organization getClusterOrganization `json:"organization"` +} + +// GetOrganization returns getClusterResponse.Organization, and is useful for accessing the field via an interface. +func (v *getClusterResponse) GetOrganization() getClusterOrganization { return v.Organization } + // getOrganizationOrganization includes the requested fields of the GraphQL type Organization. // The GraphQL type's documentation follows. // @@ -1481,17 +1486,17 @@ func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetName() string } // GetDescription returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Description, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetDescription() string { +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetDescription() *string { return v.ClusterFields.Description } // GetEmoji returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Emoji, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetEmoji() string { +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetEmoji() *string { return v.ClusterFields.Emoji } // GetColor returns updateClusterClusterUpdateClusterUpdatePayloadCluster.Color, and is useful for accessing the field via an interface. -func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetColor() string { +func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) GetColor() *string { return v.ClusterFields.Color } @@ -1527,11 +1532,11 @@ type __premarshalupdateClusterClusterUpdateClusterUpdatePayloadCluster struct { Name string `json:"name"` - Description string `json:"description"` + Description *string `json:"description"` - Emoji string `json:"emoji"` + Emoji *string `json:"emoji"` - Color string `json:"color"` + Color *string `json:"color"` } func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) MarshalJSON() ([]byte, error) { @@ -1554,17 +1559,6 @@ func (v *updateClusterClusterUpdateClusterUpdatePayloadCluster) __premarshalJSON return &retval, nil } -// updateClusterResponse is returned by updateCluster on success. -type updateClusterResponse struct { - // Updates a cluster. - ClusterUpdate updateClusterClusterUpdateClusterUpdatePayload `json:"clusterUpdate"` -} - -// GetClusterUpdate returns updateClusterResponse.ClusterUpdate, and is useful for accessing the field via an interface. -func (v *updateClusterResponse) GetClusterUpdate() updateClusterClusterUpdateClusterUpdatePayload { - return v.ClusterUpdate -} - // updateClusterQueueClusterQueueUpdateClusterQueueUpdatePayload includes the requested fields of the GraphQL type ClusterQueueUpdatePayload. // The GraphQL type's documentation follows. // @@ -1675,6 +1669,17 @@ func (v *updateClusterQueueResponse) GetClusterQueueUpdate() updateClusterQueueC return v.ClusterQueueUpdate } +// updateClusterResponse is returned by updateCluster on success. +type updateClusterResponse struct { + // Updates a cluster. + ClusterUpdate updateClusterClusterUpdateClusterUpdatePayload `json:"clusterUpdate"` +} + +// GetClusterUpdate returns updateClusterResponse.ClusterUpdate, and is useful for accessing the field via an interface. +func (v *updateClusterResponse) GetClusterUpdate() updateClusterClusterUpdateClusterUpdatePayload { + return v.ClusterUpdate +} + // updatePipelinePipelineUpdatePipelineUpdatePayload includes the requested fields of the GraphQL type PipelineUpdatePayload. // The GraphQL type's documentation follows. // @@ -2102,9 +2107,9 @@ func createCluster( client graphql.Client, organizationId string, name string, - description string, - emoji string, - color string, + description *string, + emoji *string, + color *string, ) (*createClusterResponse, error) { req := &graphql.Request{ OpName: "createCluster", @@ -2131,42 +2136,6 @@ func createCluster( return &data, err } -// The query or mutation executed by deleteCluster. -const deleteCluster_Operation = ` -mutation deleteCluster ($organizationId: ID!, $id: ID!) { - clusterDelete(input: {organizationId:$organizationId,id:$id}) { - clientMutationId - } -} -` - -func deleteCluster( - client graphql.Client, - organizationId string, - id string, -) (*deleteClusterResponse, error) { - req := &graphql.Request{ - OpName: "deleteCluster", - Query: deleteCluster_Operation, - Variables: &__deleteClusterInput{ - OrganizationId: organizationId, - Id: id, - }, - } - var err error - - var data deleteClusterResponse - resp := &graphql.Response{Data: &data} - - err = client.MakeRequest( - nil, - req, - resp, - ) - - return &data, err -} - // The query or mutation executed by createClusterQueue. const createClusterQueue_Operation = ` mutation createClusterQueue ($organizationId: ID!, $clusterId: ID!, $key: String!, $description: String) { @@ -2219,6 +2188,42 @@ func createClusterQueue( return &data, err } +// The query or mutation executed by deleteCluster. +const deleteCluster_Operation = ` +mutation deleteCluster ($organizationId: ID!, $id: ID!) { + clusterDelete(input: {organizationId:$organizationId,id:$id}) { + clientMutationId + } +} +` + +func deleteCluster( + client graphql.Client, + organizationId string, + id string, +) (*deleteClusterResponse, error) { + req := &graphql.Request{ + OpName: "deleteCluster", + Query: deleteCluster_Operation, + Variables: &__deleteClusterInput{ + OrganizationId: organizationId, + Id: id, + }, + } + var err error + + var data deleteClusterResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + nil, + req, + resp, + ) + + return &data, err +} + // The query or mutation executed by deleteClusterQueue. const deleteClusterQueue_Operation = ` mutation deleteClusterQueue ($organizationId: ID!, $id: ID!) { @@ -2614,9 +2619,9 @@ func updateCluster( organizationId string, id string, name string, - description string, - emoji string, - color string, + description *string, + emoji *string, + color *string, ) (*updateClusterResponse, error) { req := &graphql.Request{ OpName: "updateCluster", diff --git a/buildkite/graphql/cluster.graphql b/buildkite/graphql/cluster.graphql index d867772b..a75fe01b 100644 --- a/buildkite/graphql/cluster.graphql +++ b/buildkite/graphql/cluster.graphql @@ -2,8 +2,11 @@ fragment ClusterFields on Cluster { id uuid name + # @genqlient(pointer: true) description + # @genqlient(pointer: true) emoji + # @genqlient(pointer: true) color } @@ -15,16 +18,16 @@ query getCluster($orgSlug: ID!, $id: ID!) { } } -# @genqlient(for: "ClusterCreateInput.description", pointer: true) -# @genqlient(for: "ClusterCreateInput.emoji", pointer: true) -# @genqlient(for: "ClusterCreateInput.color", pointer: true) mutation createCluster( - $organizationId: ID! - $name: String! - $description: String - $emoji: String - $color: String - ) { + $organizationId: ID! + $name: String! + # @genqlient(pointer: true) + $description: String + # @genqlient(pointer: true) + $emoji: String + # @genqlient(pointer: true) + $color: String +) { clusterCreate( input: { organizationId: $organizationId, name: $name, description: $description, emoji: $emoji, color: $color } ) { @@ -35,15 +38,15 @@ mutation createCluster( } } -# @genqlient(for: "ClusterUpdateInput.description", pointer: true) -# @genqlient(for: "ClusterUpdateInput.emoji", pointer: true) -# @genqlient(for: "ClusterUpdateInput.color", pointer: true) mutation updateCluster( $organizationId: ID! $id: ID! $name: String + # @genqlient(pointer: true) $description: String + # @genqlient(pointer: true) $emoji: String + # @genqlient(pointer: true) $color: String ) { clusterUpdate( diff --git a/schema.graphql b/schema.graphql index f109f9a9..48bf8c09 100644 --- a/schema.graphql +++ b/schema.graphql @@ -474,6 +474,9 @@ enum AuditEventType { PIPELINE_SCHEDULE_CREATED PIPELINE_SCHEDULE_DELETED PIPELINE_SCHEDULE_UPDATED + PIPELINE_TEMPLATE_CREATED + PIPELINE_TEMPLATE_DELETED + PIPELINE_TEMPLATE_UPDATED PIPELINE_UPDATED PIPELINE_VISIBILITY_CHANGED PIPELINE_WEBHOOK_URL_ROTATED @@ -542,37 +545,38 @@ type AuditSubject { } """Kinds of subjects which can have audit events performed on them""" -union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | AuthorizationGitHub | AuthorizationGitHubEnterprise | Cluster | ClusterPermission | ClusterQueue | ClusterToken | Email | NotificationServiceSlack | NotificationServiceWebhook | Organization | OrganizationInvitation | OrganizationMember | Pipeline | PipelineSchedule | SCMPipelineSettings | SCMRepositoryHost | SCMService | SSOProviderGitHubApp | SSOProviderGoogleGSuite | SSOProviderSAML | Subscription | Suite | TOTP | Team | TeamMember | TeamPipeline | TeamSuite | User +union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | AuthorizationGitHub | AuthorizationGitHubEnterprise | Cluster | ClusterPermission | ClusterQueue | ClusterToken | Email | NotificationServiceSlack | NotificationServiceWebhook | Organization | OrganizationInvitation | OrganizationMember | Pipeline | PipelineSchedule | PipelineTemplate | SCMPipelineSettings | SCMRepositoryHost | SCMService | SSOProviderGitHubApp | SSOProviderGoogleGSuite | SSOProviderSAML | Subscription | Suite | TOTP | Team | TeamMember | TeamPipeline | TeamSuite | User """All the possible types of subjects in an Audit Event""" enum AuditSubjectType { - SUITE - USER_EMAIL - USER_TOTP - SSO_PROVIDER - ORGANIZATION_MEMBER - USER - CLUSTER - AUTHORIZATION - SUBSCRIPTION - CLUSTER_PERMISSION - AGENT_TOKEN - API_ACCESS_TOKEN - CLUSTER_QUEUE - CLUSTER_TOKEN NOTIFICATION_SERVICE ORGANIZATION ORGANIZATION_INVITATION PIPELINE_SCHEDULE + PIPELINE_TEMPLATE TEAM TEAM_MEMBER TEAM_PIPELINE - PIPELINE TEAM_SUITE - SCM_SERVICE + SSO_PROVIDER + ORGANIZATION_MEMBER SCM_PIPELINE_SETTINGS SCM_REPOSITORY_HOST SUITE_MONITOR + AUTHORIZATION + SCM_SERVICE + SUBSCRIPTION + USER_EMAIL + USER_TOTP + SUITE + PIPELINE + USER + CLUSTER_PERMISSION + CLUSTER + AGENT_TOKEN + API_ACCESS_TOKEN + CLUSTER_QUEUE + CLUSTER_TOKEN } """Context for an audit event created during a web request""" @@ -2765,7 +2769,7 @@ type Organization implements Node{ """Order the teams""" order: TeamOrder ): TeamConnection -"""Returns the resource usage data for this organization. Please note that this feature is not yet available to all organizations""" +"""Returns the resource usage data for this organization.""" usage( """Returns the elements in the list that come after the specified cursor.""" after: String @@ -3500,7 +3504,7 @@ input PipelineCreateInput { """Autogenerated input type of PipelineCreate""" repository: PipelineRepositoryInput! """Autogenerated input type of PipelineCreate""" - steps: PipelineStepsInput! + steps: PipelineStepsInput """Autogenerated input type of PipelineCreate""" skipIntermediateBuilds: Boolean """Autogenerated input type of PipelineCreate""" @@ -3529,6 +3533,8 @@ input PipelineCreateInput { nextBuildNumber: Int """Autogenerated input type of PipelineCreate""" clusterId: ID +"""Autogenerated input type of PipelineCreate""" + pipelineTemplateId: ID """Autogenerated input type of PipelineCreate""" tags: [PipelineTagInput!] """Autogenerated input type of PipelineCreate""" @@ -3543,6 +3549,7 @@ type PipelineCreatePayload { organization: Organization! pipeline: Pipeline! pipelineEdge: PipelineEdge! + pipelineTemplate: PipelineTemplate } """Autogenerated input type of PipelineCreateWebhook""" @@ -3921,6 +3928,8 @@ input PipelineUpdateInput { buildRetentionNumber: Int """Autogenerated input type of PipelineUpdate""" clusterId: ID +"""Autogenerated input type of PipelineUpdate""" + pipelineTemplateId: ID """Autogenerated input type of PipelineUpdate""" archived: Boolean """Autogenerated input type of PipelineUpdate""" From 49f7e7f5dc23918ef0632db6940d2ff34876b021 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 16:17:00 +1000 Subject: [PATCH 26/37] Change to pointer value --- buildkite/resource_cluster.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 83422d27..85c37ab6 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -90,9 +90,9 @@ func (c *clusterResource) Create(ctx context.Context, req resource.CreateRequest c.client.genqlient, c.client.organizationId, state.Name.ValueString(), - state.Description.ValueString(), - state.Emoji.ValueString(), - state.Color.ValueString(), + state.Description.ValueStringPointer(), + state.Emoji.ValueStringPointer(), + state.Color.ValueStringPointer(), ) if err != nil { @@ -149,9 +149,9 @@ func (c *clusterResource) Update(ctx context.Context, req resource.UpdateRequest c.client.organizationId, id, plan.Name.ValueString(), - plan.Description.ValueString(), - plan.Emoji.ValueString(), - plan.Color.ValueString(), + plan.Description.ValueStringPointer(), + plan.Emoji.ValueStringPointer(), + plan.Color.ValueStringPointer(), ) if err != nil { @@ -193,7 +193,7 @@ func updateClusterResourceState(cl getClusterOrganizationCluster, c *clusterReso c.ID = types.StringValue(cl.Id) c.UUID = types.StringValue(cl.Uuid) c.Name = types.StringValue(cl.Name) - c.Description = types.StringValue(cl.Description) - c.Emoji = types.StringValue(cl.Emoji) - c.Color = types.StringValue(cl.Color) + c.Description = types.StringPointerValue(cl.Description) + c.Emoji = types.StringPointerValue(cl.Emoji) + c.Color = types.StringPointerValue(cl.Color) } From baaaeff6fe3273f0ce2a3723abc009aaf47747b0 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 16:24:58 +1000 Subject: [PATCH 27/37] Fix the damn tests. --- buildkite/resource_cluster_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index ae505fb9..30690205 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -31,8 +31,8 @@ func TestAccCluster_AddRemove(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), testAccCheckClusterRemoteValues(&c, "foo_test_cluster"), - resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), - resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "id", c.ID.ValueString()), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "uuid", c.UUID.ValueString()), ), }, }, @@ -104,11 +104,13 @@ func testAccCheckClusterExists(n string, c *clusterResourceModel) resource.TestC return fmt.Errorf("no cluster ID is set") } - _, err := getCluster(genqlientGraphql, getenv("BUILDKITE_ORGANIZATION_SLUG"), rs.Primary.Attributes["uuid"]) + r, err := getCluster(genqlientGraphql, getenv("BUILDKITE_ORGANIZATION_SLUG"), rs.Primary.Attributes["uuid"]) if err != nil { return err } + + updateClusterResourceState(r.Organization.Cluster, c) return nil } } From 66e6fe698c74caeb0b1c81ef9dbf71a5507b1691 Mon Sep 17 00:00:00 2001 From: Jarryd Tilbrook Date: Tue, 4 Jul 2023 15:34:37 +0800 Subject: [PATCH 28/37] Fix import test --- buildkite/resource_cluster_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 30690205..c2b38d6d 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -31,8 +31,8 @@ func TestAccCluster_AddRemove(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), testAccCheckClusterRemoteValues(&c, "foo_test_cluster"), - resource.TestCheckResourceAttr("buildkite_cluster.foo", "id", c.ID.ValueString()), - resource.TestCheckResourceAttr("buildkite_cluster.foo", "uuid", c.UUID.ValueString()), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), ), }, }, @@ -54,6 +54,8 @@ func TestAccCluster_Update(t *testing.T) { testAccCheckClusterExists("buildkite_cluster.foo", &c), testAccCheckClusterRemoteValues(&c, "bar_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "bar_test_cluster"), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), ), }, { @@ -69,6 +71,7 @@ func TestAccCluster_Update(t *testing.T) { } func TestAccCluster_Import(t *testing.T) { + t.Parallel() var c clusterResourceModel resource.Test(t, resource.TestCase{ @@ -87,7 +90,9 @@ func TestAccCluster_Import(t *testing.T) { ResourceName: "buildkite_cluster.foo", ImportState: true, ImportStateVerify: true, - ImportStateId: c.UUID.ValueString(), + ImportStateIdFunc: func(s *terraform.State) (string, error) { + return c.UUID.ValueString(), nil + }, }, }, }) From d84860946fab700e18e564d75feec89e35337e0c Mon Sep 17 00:00:00 2001 From: Jarryd Tilbrook Date: Wed, 5 Jul 2023 10:53:28 +0800 Subject: [PATCH 29/37] Omit new pipeline template input --- buildkite/generated.go | 2 +- buildkite/graphql/pipeline.graphql | 1 + schema.graphql | 68 ++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 15 deletions(-) diff --git a/buildkite/generated.go b/buildkite/generated.go index dd8bfcc8..bb3b2132 100644 --- a/buildkite/generated.go +++ b/buildkite/generated.go @@ -205,7 +205,7 @@ type PipelineUpdateInput struct { // Autogenerated input type of PipelineUpdate ClusterId *string `json:"clusterId"` // Autogenerated input type of PipelineUpdate - PipelineTemplateId string `json:"pipelineTemplateId"` + PipelineTemplateId string `json:"pipelineTemplateId,omitempty"` // Autogenerated input type of PipelineUpdate Archived bool `json:"archived,omitempty"` // Autogenerated input type of PipelineUpdate diff --git a/buildkite/graphql/pipeline.graphql b/buildkite/graphql/pipeline.graphql index 1cef5fb9..b858c31d 100644 --- a/buildkite/graphql/pipeline.graphql +++ b/buildkite/graphql/pipeline.graphql @@ -18,6 +18,7 @@ query getPipeline($slug: ID!) { # @genqlient(for: "PipelineUpdateInput.buildRetentionEnabled", omitempty: true) # @genqlient(for: "PipelineUpdateInput.buildRetentionPeriod", omitempty: true) # @genqlient(for: "PipelineUpdateInput.buildRetentionNumber", omitempty: true) +# @genqlient(for: "PipelineUpdateInput.pipelineTemplateId", omitempty: true) # @genqlient(for: "PipelineUpdateInput.archived", omitempty: true) # @genqlient(for: "PipelineUpdateInput.nextBuildNumber", omitempty: true) mutation updatePipeline( diff --git a/schema.graphql b/schema.graphql index 48bf8c09..13b67211 100644 --- a/schema.graphql +++ b/schema.graphql @@ -549,34 +549,34 @@ union AuditSubjectNode =APIAccessToken | AgentToken | AuthorizationBitbucket | A """All the possible types of subjects in an Audit Event""" enum AuditSubjectType { + AUTHORIZATION + SUBSCRIPTION + AGENT_TOKEN + API_ACCESS_TOKEN + CLUSTER_QUEUE + CLUSTER_TOKEN NOTIFICATION_SERVICE + SSO_PROVIDER ORGANIZATION ORGANIZATION_INVITATION PIPELINE_SCHEDULE - PIPELINE_TEMPLATE + ORGANIZATION_MEMBER TEAM - TEAM_MEMBER + PIPELINE_TEMPLATE TEAM_PIPELINE + TEAM_MEMBER + SCM_SERVICE TEAM_SUITE - SSO_PROVIDER - ORGANIZATION_MEMBER - SCM_PIPELINE_SETTINGS SCM_REPOSITORY_HOST + SCM_PIPELINE_SETTINGS + SUITE SUITE_MONITOR - AUTHORIZATION - SCM_SERVICE - SUBSCRIPTION + PIPELINE USER_EMAIL USER_TOTP - SUITE - PIPELINE USER CLUSTER_PERMISSION CLUSTER - AGENT_TOKEN - API_ACCESS_TOKEN - CLUSTER_QUEUE - CLUSTER_TOKEN } """Context for an audit event created during a web request""" @@ -2288,6 +2288,11 @@ type Mutation { """Parameters for OrganizationMemberUpdate""" input: OrganizationMemberUpdateInput! ): OrganizationMemberUpdatePayload +"""Specify the maximum timeframe to revoke organization access from inactive API tokens.""" + organizationRevokeInactiveTokensAfterUpdate( +"""Parameters for OrganizationRevokeInactiveTokensAfterUpdateMutation""" + input: OrganizationRevokeInactiveTokensAfterUpdateMutationInput! + ): OrganizationRevokeInactiveTokensAfterUpdateMutationPayload """Archive a pipeline.""" pipelineArchive( """Parameters for PipelineArchive""" @@ -2722,6 +2727,8 @@ type Organization implements Node{ ): PipelineConnection """Whether this organization is visible to everyone, including people outside it""" public: Boolean! +"""API tokens with access to this organization will be automatically revoked after this many seconds of inactivity. A `null` value indicates never revoke inactive tokens.""" + revokeInactiveTokensAfter: RevokeInactiveTokenPeriod """The slug used to represent the organization in URLs""" slug: String! """The single sign-on configuration of this organization""" @@ -3286,6 +3293,23 @@ type OrganizationPermissions { teamView: Permission } +"""Autogenerated input type of OrganizationRevokeInactiveTokensAfterUpdateMutation""" +input OrganizationRevokeInactiveTokensAfterUpdateMutationInput { +"""Autogenerated input type of OrganizationRevokeInactiveTokensAfterUpdateMutation""" + clientMutationId: String +"""Autogenerated input type of OrganizationRevokeInactiveTokensAfterUpdateMutation""" + organizationId: ID! +"""Autogenerated input type of OrganizationRevokeInactiveTokensAfterUpdateMutation""" + revokeInactiveTokensAfter: RevokeInactiveTokenPeriod! +} + +"""Autogenerated return type of OrganizationRevokeInactiveTokensAfterUpdateMutation.""" +type OrganizationRevokeInactiveTokensAfterUpdateMutationPayload { +"""A unique identifier for the client performing the mutation.""" + clientMutationId: String + organization: Organization +} + """Single sign-on settings for an organization""" type OrganizationSSO { """Whether this account is configured for single sign-on""" @@ -4202,6 +4226,22 @@ enum ResourceUsageType { TEST_EXECUTIONS } +"""API tokens with access to this organization will be automatically revoked after this many days of inactivity.""" +enum RevokeInactiveTokenPeriod { +"""Revoke organization access from API tokens after 30 days of inactivity""" + DAYS_30 +"""Revoke organization access from API tokens after 60 days of inactivity""" + DAYS_60 +"""Revoke organization access from API tokens after 90 days of inactivity""" + DAYS_90 +"""Revoke organization access from API tokens after 180 days of inactivity""" + DAYS_180 +"""Revoke organization access from API tokens after 365 days of inactivity""" + DAYS_365 +"""Never revoke organization access from inactive API tokens""" + NEVER +} + type SCMPipelineSettings { id: ID! } From 92f3ab59054ca5cbcbd22d0d4140efd1fe5ab69e Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Tue, 4 Jul 2023 19:18:28 +1000 Subject: [PATCH 30/37] Local changes so can fetch upstream changes --- buildkite/resource_cluster.go | 1 + buildkite/resource_cluster_test.go | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index 85c37ab6..a404360d 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -186,6 +186,7 @@ func (c *clusterResource) Delete(ctx context.Context, req resource.DeleteRequest } func (c *clusterResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + req.ID = "" resource.ImportStatePassthroughID(ctx, path.Root("uuid"), req, resp) } diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index c2b38d6d..ab66a77c 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -31,10 +31,18 @@ func TestAccCluster_AddRemove(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), testAccCheckClusterRemoteValues(&c, "foo_test_cluster"), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "foo_test_cluster"), resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), ), }, + { + RefreshState: true, + PlanOnly: true, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "name"), + ), + }, }, }) } @@ -63,7 +71,7 @@ func TestAccCluster_Update(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), testAccCheckClusterRemoteValues(&c, "baz_test_cluster"), - resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", c.Name.ValueString()), ), }, }, From 4eabb68ec138347a6631030f65fee5dcbba9ded5 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 5 Jul 2023 13:23:59 +1000 Subject: [PATCH 31/37] Make Update pass. --- buildkite/resource_cluster_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index ab66a77c..9d642846 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -71,7 +71,7 @@ func TestAccCluster_Update(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), testAccCheckClusterRemoteValues(&c, "baz_test_cluster"), - resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", c.Name.ValueString()), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), ), }, }, @@ -96,11 +96,11 @@ func TestAccCluster_Import(t *testing.T) { }, { ResourceName: "buildkite_cluster.foo", - ImportState: true, - ImportStateVerify: true, ImportStateIdFunc: func(s *terraform.State) (string, error) { return c.UUID.ValueString(), nil }, + ImportState: true, + ImportStateVerify: true, }, }, }) From 6a5915d89f4b417f4c22299140f75b2b1ad2f765 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 5 Jul 2023 13:25:58 +1000 Subject: [PATCH 32/37] fmt --- buildkite/resource_cluster_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 9d642846..c7767c5e 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -71,7 +71,7 @@ func TestAccCluster_Update(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists("buildkite_cluster.foo", &c), testAccCheckClusterRemoteValues(&c, "baz_test_cluster"), - resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), + resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), ), }, }, @@ -95,7 +95,7 @@ func TestAccCluster_Import(t *testing.T) { ), }, { - ResourceName: "buildkite_cluster.foo", + ResourceName: "buildkite_cluster.foo", ImportStateIdFunc: func(s *terraform.State) (string, error) { return c.UUID.ValueString(), nil }, From eec30c86590a99b847f2e1e2fe747a6e060bf67a Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 5 Jul 2023 13:40:16 +1000 Subject: [PATCH 33/37] Use new() to create a non-empty --- buildkite/resource_cluster_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index c7767c5e..147e5218 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -49,7 +49,7 @@ func TestAccCluster_AddRemove(t *testing.T) { func TestAccCluster_Update(t *testing.T) { t.Parallel() - var c clusterResourceModel + var c = new(clusterResourceModel) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -59,8 +59,8 @@ func TestAccCluster_Update(t *testing.T) { { Config: testAccClusterBasic("bar"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterExists("buildkite_cluster.foo", &c), - testAccCheckClusterRemoteValues(&c, "bar_test_cluster"), + testAccCheckClusterExists("buildkite_cluster.foo", c), + testAccCheckClusterRemoteValues(c, "bar_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "bar_test_cluster"), resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "id"), resource.TestCheckResourceAttrSet("buildkite_cluster.foo", "uuid"), @@ -69,8 +69,8 @@ func TestAccCluster_Update(t *testing.T) { { Config: testAccClusterBasic("baz"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterExists("buildkite_cluster.foo", &c), - testAccCheckClusterRemoteValues(&c, "baz_test_cluster"), + testAccCheckClusterExists("buildkite_cluster.foo", c), + testAccCheckClusterRemoteValues(c, "baz_test_cluster"), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "baz_test_cluster"), ), }, @@ -80,7 +80,7 @@ func TestAccCluster_Update(t *testing.T) { func TestAccCluster_Import(t *testing.T) { t.Parallel() - var c clusterResourceModel + var c = new(clusterResourceModel) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -90,7 +90,7 @@ func TestAccCluster_Import(t *testing.T) { { Config: testAccClusterBasic("imported"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterExists("buildkite_cluster.foo", &c), + testAccCheckClusterExists("buildkite_cluster.foo", c), resource.TestCheckResourceAttr("buildkite_cluster.foo", "name", "imported_test_cluster"), ), }, From d5ec7ba3433f6da6281d2f84693fd35a801570b8 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 5 Jul 2023 14:17:16 +1000 Subject: [PATCH 34/37] Empyting ID caused issue. --- buildkite/resource_cluster.go | 1 - buildkite/resource_cluster_test.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/buildkite/resource_cluster.go b/buildkite/resource_cluster.go index a404360d..85c37ab6 100644 --- a/buildkite/resource_cluster.go +++ b/buildkite/resource_cluster.go @@ -186,7 +186,6 @@ func (c *clusterResource) Delete(ctx context.Context, req resource.DeleteRequest } func (c *clusterResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - req.ID = "" resource.ImportStatePassthroughID(ctx, path.Root("uuid"), req, resp) } diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 147e5218..9ede5a19 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -97,7 +97,7 @@ func TestAccCluster_Import(t *testing.T) { { ResourceName: "buildkite_cluster.foo", ImportStateIdFunc: func(s *terraform.State) (string, error) { - return c.UUID.ValueString(), nil + return c.UUID.ValueString(), nil }, ImportState: true, ImportStateVerify: true, From e1743963f5a7fdfd005682c4e300955a9d54cf6b Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 5 Jul 2023 14:18:45 +1000 Subject: [PATCH 35/37] gofmt --- buildkite/resource_cluster_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildkite/resource_cluster_test.go b/buildkite/resource_cluster_test.go index 9ede5a19..147e5218 100644 --- a/buildkite/resource_cluster_test.go +++ b/buildkite/resource_cluster_test.go @@ -97,7 +97,7 @@ func TestAccCluster_Import(t *testing.T) { { ResourceName: "buildkite_cluster.foo", ImportStateIdFunc: func(s *terraform.State) (string, error) { - return c.UUID.ValueString(), nil + return c.UUID.ValueString(), nil }, ImportState: true, ImportStateVerify: true, From 80e10371ca19dde873b79aa1a89ebd68449a2478 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 5 Jul 2023 14:38:48 +1000 Subject: [PATCH 36/37] CHANGELOG and docs --- CHANGELOG.md | 1 + docs/resources/cluster.md | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d18b5d2..4f883bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. * Support option to archive on delete [[PR #296](https://github.com/buildkite/terraform-provider-buildkite/pull/296)] @mcncl * SUP-1085: Cluster Queue resource implementation [[PR #297](https://github.com/buildkite/terraform-provider-buildkite/pull/297)] @james2791 * SUP-270 Fix branch_configuration updating to empty string [[PR #298](https://github.com/buildkite/terraform-provider-buildkite/pull/298)] @jradtilbrook +* SUP-1084 Add Cluster resource [[PR #301](https://github.com/buildkite/terraform-provider-buildkite/pull/301)] @mcncl ## [v0.19.2](https://github.com/buildkite/terraform-provider-buildkite/compare/v0.19.1...v0.19.2) * Consistent naming for environment variables [[PR #290](https://github.com/buildkite/terraform-provider-buildkite/pull/290)] @mcncl diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 2921049b..9ec568a2 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -26,4 +26,29 @@ resource "buildkite_cluster" "linux" { * `id` - The GraphQL ID that is created with the Cluster. * `uuid` - The UUID created with the Cluster. -The `uuid` is used when *getting* a Cluster. The `id` is used when *modifying* a Cluster. +The `uuid` is used when *getting* a Cluster. The `id` is used when *modifying* a Cluster. + +## import +Clusters can be imported using their `UUID`, this is the `-` separated identifier in the Clusters's `Settings` page, e.g. + +```shell +terraform import buildkite_cluster.foo 878a539f-2c77-435e-9675-936263eb9c08 +``` + +A helpful GraphQL query to get the UUID of the target cluster can be found below, or [this pre-saved query](https://buildkite.com/user/graphql/console/49ad82a8-fb96-43a3-bfae-73f6e3c9a297) can be used as a template. You'll need to substitute in your organization's `slug`. + +```graphql +query getClusters { + organization(slug: "ORGANIZATION"){ + clusters(first: 5, order:NAME) { + edges{ + node { + uuid + name + } + } + } + } +} +``` + From f25ffad0e0dfff3af345c2aecb214ed62aa63451 Mon Sep 17 00:00:00 2001 From: Ben McNicholl Date: Wed, 5 Jul 2023 14:42:49 +1000 Subject: [PATCH 37/37] %s/E/e --- docs/resources/cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 9ec568a2..7e66588e 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -7,7 +7,7 @@ Buildkite documentation: https://buildkite.com/docs/clusters/overview ## Example Usage ```hcl -provider "buildkitE" {} +provider "buildkite" {} resource "buildkite_cluster" "linux" { name = "linux_builds"