diff --git a/client.go b/client.go index 4bc6fd0..24f9dc5 100644 --- a/client.go +++ b/client.go @@ -218,6 +218,7 @@ type RootMutationType struct { SsoCallback *User "json:\"ssoCallback\" graphql:\"ssoCallback\"" StopShell *bool "json:\"stopShell\" graphql:\"stopShell\"" TransferDemoProject *DemoProject "json:\"transferDemoProject\" graphql:\"transferDemoProject\"" + TransferOwnership *Cluster "json:\"transferOwnership\" graphql:\"transferOwnership\"" UnfollowIncident *Follower "json:\"unfollowIncident\" graphql:\"unfollowIncident\"" UninstallTerraform *TerraformInstallation "json:\"uninstallTerraform\" graphql:\"uninstallTerraform\"" UnlockRepository *int64 "json:\"unlockRepository\" graphql:\"unlockRepository\"" @@ -596,6 +597,11 @@ type CreateDependency struct { type PromoteCluster struct { Promote *UserFragment "json:\"promote\" graphql:\"promote\"" } +type TransferOwnership struct { + TransferOwnership *struct { + ID string "json:\"id\" graphql:\"id\"" + } "json:\"transferOwnership\" graphql:\"transferOwnership\"" +} type GetDNSRecords struct { DNSRecords *struct { Edges []*struct { @@ -1127,6 +1133,24 @@ const GetChartInstallationsDocument = `query GetChartInstallations ($id: ID!) { } } } +fragment ChartInstallationFragment on ChartInstallation { + id + chart { + ... ChartFragment + dependencies { + ... DependenciesFragment + } + } + version { + ... VersionFragment + } +} +fragment ChartFragment on Chart { + id + name + description + latestVersion +} fragment DependenciesFragment on Dependencies { dependencies { type @@ -1171,24 +1195,6 @@ fragment CrdFragment on Crd { name blob } -fragment ChartInstallationFragment on ChartInstallation { - id - chart { - ... ChartFragment - dependencies { - ... DependenciesFragment - } - } - version { - ... VersionFragment - } -} -fragment ChartFragment on Chart { - id - name - description - latestVersion -} ` func (c *Client) GetChartInstallations(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*GetChartInstallations, error) { @@ -1220,24 +1226,6 @@ const GetPackageInstallationsDocument = `query GetPackageInstallations ($id: ID! } } } -fragment ChartInstallationFragment on ChartInstallation { - id - chart { - ... ChartFragment - dependencies { - ... DependenciesFragment - } - } - version { - ... VersionFragment - } -} -fragment ChartFragment on Chart { - id - name - description - latestVersion -} fragment DependenciesFragment on Dependencies { dependencies { type @@ -1301,6 +1289,24 @@ fragment TerraformFragment on Terraform { } valuesTemplate } +fragment ChartInstallationFragment on ChartInstallation { + id + chart { + ... ChartFragment + dependencies { + ... DependenciesFragment + } + } + version { + ... VersionFragment + } +} +fragment ChartFragment on Chart { + id + name + description + latestVersion +} ` func (c *Client) GetPackageInstallations(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*GetPackageInstallations, error) { @@ -1434,6 +1440,16 @@ const ClusterInfoDocument = `query ClusterInfo ($id: ID!) { } } } +fragment ClusterFragment on Cluster { + id + name + provider + source + gitUrl + owner { + ... UserFragment + } +} fragment UserFragment on User { id name @@ -1453,16 +1469,6 @@ fragment RepositoryFragment on Repository { name } } -fragment ClusterFragment on Cluster { - id - name - provider - source - gitUrl - owner { - ... UserFragment - } -} ` func (c *Client) ClusterInfo(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*ClusterInfo, error) { @@ -1522,6 +1528,27 @@ func (c *Client) PromoteCluster(ctx context.Context, httpRequestOptions ...clien return &res, nil } +const TransferOwnershipDocument = `mutation TransferOwnership ($name: String!, $email: String!) { + transferOwnership(name: $name, email: $email) { + id + } +} +` + +func (c *Client) TransferOwnership(ctx context.Context, name string, email string, httpRequestOptions ...client.HTTPRequestOption) (*TransferOwnership, error) { + vars := map[string]interface{}{ + "name": name, + "email": email, + } + + var res TransferOwnership + if err := c.Client.Post(ctx, "TransferOwnership", TransferOwnershipDocument, &res, vars, httpRequestOptions...); err != nil { + return nil, err + } + + return &res, nil +} + const GetDNSRecordsDocument = `query GetDnsRecords ($cluster: String!, $provider: Provider!) { dnsRecords(cluster: $cluster, provider: $provider, first: 500) { edges { @@ -1704,6 +1731,19 @@ const GetInstallationByIDDocument = `query GetInstallationById ($id: ID) { ... InstallationFragment } } +fragment InstallationFragment on Installation { + id + context + licenseKey + acmeKeyId + acmeSecret + repository { + ... RepositoryFragment + } + oidcProvider { + ... OIDCProvider + } +} fragment RepositoryFragment on Repository { id name @@ -1741,19 +1781,6 @@ fragment OIDCProvider on OidcProvider { userinfoEndpoint } } -fragment InstallationFragment on Installation { - id - context - licenseKey - acmeKeyId - acmeSecret - repository { - ... RepositoryFragment - } - oidcProvider { - ... OIDCProvider - } -} ` func (c *Client) GetInstallationByID(ctx context.Context, id *string, httpRequestOptions ...client.HTTPRequestOption) (*GetInstallationByID, error) { @@ -1778,29 +1805,6 @@ const GetInstallationsDocument = `query GetInstallations { } } } -fragment OIDCProvider on OidcProvider { - id - clientId - clientSecret - redirectUris - bindings { - user { - id - email - } - group { - id - name - } - } - configuration { - issuer - authorizationEndpoint - tokenEndpoint - jwksUri - userinfoEndpoint - } -} fragment InstallationFragment on Installation { id context @@ -1828,6 +1832,29 @@ fragment RepositoryFragment on Repository { name } } +fragment OIDCProvider on OidcProvider { + id + clientId + clientSecret + redirectUris + bindings { + user { + id + email + } + group { + id + name + } + } + configuration { + issuer + authorizationEndpoint + tokenEndpoint + jwksUri + userinfoEndpoint + } +} ` func (c *Client) GetInstallations(ctx context.Context, httpRequestOptions ...client.HTTPRequestOption) (*GetInstallations, error) { @@ -1906,6 +1933,16 @@ const GetRecipeDocument = `query GetRecipe ($repo: String, $name: String) { } } } +fragment TerraformFragment on Terraform { + id + name + package + description + dependencies { + ... DependenciesFragment + } + valuesTemplate +} fragment DependenciesFragment on Dependencies { dependencies { type @@ -2026,16 +2063,6 @@ fragment ChartFragment on Chart { description latestVersion } -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} ` func (c *Client) GetRecipe(ctx context.Context, repo *string, name *string, httpRequestOptions ...client.HTTPRequestOption) (*GetRecipe, error) { @@ -2060,48 +2087,6 @@ const GetRecipeByIDDocument = `query GetRecipeByID ($id: ID) { } } } -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name - } - recipes { - name - } -} -fragment RecipeItemFragment on RecipeItem { - id - chart { - ... ChartFragment - } - terraform { - ... TerraformFragment - } - configuration { - ... RecipeConfigurationFragment - } -} -fragment ChartFragment on Chart { - id - name - description - latestVersion -} -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} fragment DependenciesFragment on Dependencies { dependencies { type @@ -2190,18 +2175,60 @@ fragment RecipeSectionFragment on RecipeSection { ... RecipeConfigurationFragment } } -` - -func (c *Client) GetRecipeByID(ctx context.Context, id *string, httpRequestOptions ...client.HTTPRequestOption) (*GetRecipeByID, error) { - vars := map[string]interface{}{ - "id": id, - } - - var res GetRecipeByID - if err := c.Client.Post(ctx, "GetRecipeByID", GetRecipeByIDDocument, &res, vars, httpRequestOptions...); err != nil { - return nil, err - } - +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name + } + recipes { + name + } +} +fragment RecipeItemFragment on RecipeItem { + id + chart { + ... ChartFragment + } + terraform { + ... TerraformFragment + } + configuration { + ... RecipeConfigurationFragment + } +} +fragment ChartFragment on Chart { + id + name + description + latestVersion +} +fragment TerraformFragment on Terraform { + id + name + package + description + dependencies { + ... DependenciesFragment + } + valuesTemplate +} +` + +func (c *Client) GetRecipeByID(ctx context.Context, id *string, httpRequestOptions ...client.HTTPRequestOption) (*GetRecipeByID, error) { + vars := map[string]interface{}{ + "id": id, + } + + var res GetRecipeByID + if err := c.Client.Post(ctx, "GetRecipeByID", GetRecipeByIDDocument, &res, vars, httpRequestOptions...); err != nil { + return nil, err + } + return &res, nil } @@ -2214,6 +2241,32 @@ const ListRecipesDocument = `query ListRecipes ($repo: String, $provider: Provid } } } +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name + } + recipes { + name + } +} +fragment RecipeItemFragment on RecipeItem { + id + chart { + ... ChartFragment + } + terraform { + ... TerraformFragment + } + configuration { + ... RecipeConfigurationFragment + } +} fragment ChartFragment on Chart { id name @@ -2318,32 +2371,6 @@ fragment RecipeSectionFragment on RecipeSection { ... RecipeConfigurationFragment } } -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name - } - recipes { - name - } -} -fragment RecipeItemFragment on RecipeItem { - id - chart { - ... ChartFragment - } - terraform { - ... TerraformFragment - } - configuration { - ... RecipeConfigurationFragment - } -} ` func (c *Client) ListRecipes(ctx context.Context, repo *string, provider *Provider, httpRequestOptions ...client.HTTPRequestOption) (*ListRecipes, error) { @@ -2369,38 +2396,6 @@ const ListAllRecipesDocument = `query ListAllRecipes ($repo: String) { } } } -fragment RecipeFragment on Recipe { - id - name - primary - description - restricted - provider - tests { - type - name - message - args { - name - repo - key - } - } - repository { - id - name - } - oidcSettings { - uriFormat - uriFormats - authMethod - domainKey - subdomain - } - recipeSections { - ... RecipeSectionFragment - } -} fragment RecipeSectionFragment on RecipeSection { index repository { @@ -2499,6 +2494,38 @@ fragment RecipeConfigurationFragment on RecipeConfiguration { message } } +fragment RecipeFragment on Recipe { + id + name + primary + description + restricted + provider + tests { + type + name + message + args { + name + repo + key + } + } + repository { + id + name + } + oidcSettings { + uriFormat + uriFormats + authMethod + domainKey + subdomain + } + recipeSections { + ... RecipeSectionFragment + } +} ` func (c *Client) ListAllRecipes(ctx context.Context, repo *string, httpRequestOptions ...client.HTTPRequestOption) (*ListAllRecipes, error) { @@ -2580,6 +2607,72 @@ const GetStackDocument = `query GetStack ($name: String!, $provider: Provider!) ... StackFragment } } +fragment RecipeSectionFragment on RecipeSection { + index + repository { + ... RepositoryFragment + } + recipeItems { + ... RecipeItemFragment + } + configuration { + ... RecipeConfigurationFragment + } +} +fragment TerraformFragment on Terraform { + id + name + package + description + dependencies { + ... DependenciesFragment + } + valuesTemplate +} +fragment DependenciesFragment on Dependencies { + dependencies { + type + name + repo + optional + version + } + breaking + instructions { + instructions + script + } + wait + application + providers + secrets + wirings { + terraform + helm + } + providerWirings + outputs + providerVsn +} +fragment RecipeConfigurationFragment on RecipeConfiguration { + name + type + default + documentation + optional + placeholder + functionName + condition { + field + operation + value + } + validation { + type + regex + message + } +} fragment StackFragment on Stack { id name @@ -2621,16 +2714,18 @@ fragment RecipeFragment on Recipe { ... RecipeSectionFragment } } -fragment RecipeSectionFragment on RecipeSection { - index - repository { - ... RepositoryFragment - } - recipeItems { - ... RecipeItemFragment +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name } - configuration { - ... RecipeConfigurationFragment + recipes { + name } } fragment RecipeItemFragment on RecipeItem { @@ -2645,80 +2740,12 @@ fragment RecipeItemFragment on RecipeItem { ... RecipeConfigurationFragment } } -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} -fragment RecipeConfigurationFragment on RecipeConfiguration { - name - type - default - documentation - optional - placeholder - functionName - condition { - field - operation - value - } - validation { - type - regex - message - } -} -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name - } - recipes { - name - } -} fragment ChartFragment on Chart { id name description latestVersion } -fragment DependenciesFragment on Dependencies { - dependencies { - type - name - repo - optional - version - } - breaking - instructions { - instructions - script - } - wait - application - providers - secrets - wirings { - terraform - helm - } - providerWirings - outputs - providerVsn -} ` func (c *Client) GetStack(ctx context.Context, name string, provider Provider, httpRequestOptions ...client.HTTPRequestOption) (*GetStack, error) { @@ -2744,38 +2771,29 @@ const ListStacksDocument = `query ListStacks ($featured: Boolean, $cursor: Strin } } } -fragment DependenciesFragment on Dependencies { - dependencies { - type - name - repo - optional - version - } - breaking - instructions { - instructions - script - } - wait - application - providers - secrets - wirings { - terraform - helm - } - providerWirings - outputs - providerVsn -} -fragment StackFragment on Stack { +fragment ChartFragment on Chart { id name - featured description - bundles { - ... RecipeFragment + latestVersion +} +fragment RecipeConfigurationFragment on RecipeConfiguration { + name + type + default + documentation + optional + placeholder + functionName + condition { + field + operation + value + } + validation { + type + regex + message } } fragment RecipeFragment on Recipe { @@ -2810,6 +2828,18 @@ fragment RecipeFragment on Recipe { ... RecipeSectionFragment } } +fragment RecipeSectionFragment on RecipeSection { + index + repository { + ... RepositoryFragment + } + recipeItems { + ... RecipeItemFragment + } + configuration { + ... RecipeConfigurationFragment + } +} fragment RepositoryFragment on Repository { id name @@ -2824,31 +2854,47 @@ fragment RepositoryFragment on Repository { name } } -fragment RecipeItemFragment on RecipeItem { - id - chart { - ... ChartFragment +fragment DependenciesFragment on Dependencies { + dependencies { + type + name + repo + optional + version } - terraform { - ... TerraformFragment + breaking + instructions { + instructions + script } - configuration { - ... RecipeConfigurationFragment + wait + application + providers + secrets + wirings { + terraform + helm } + providerWirings + outputs + providerVsn } -fragment ChartFragment on Chart { +fragment StackFragment on Stack { id name + featured description - latestVersion + bundles { + ... RecipeFragment + } } -fragment RecipeSectionFragment on RecipeSection { - index - repository { - ... RepositoryFragment +fragment RecipeItemFragment on RecipeItem { + id + chart { + ... ChartFragment } - recipeItems { - ... RecipeItemFragment + terraform { + ... TerraformFragment } configuration { ... RecipeConfigurationFragment @@ -2864,25 +2910,6 @@ fragment TerraformFragment on Terraform { } valuesTemplate } -fragment RecipeConfigurationFragment on RecipeConfiguration { - name - type - default - documentation - optional - placeholder - functionName - condition { - field - operation - value - } - validation { - type - regex - message - } -} ` func (c *Client) ListStacks(ctx context.Context, featured *bool, cursor *string, httpRequestOptions ...client.HTTPRequestOption) (*ListStacks, error) { @@ -3320,6 +3347,11 @@ const GetTerraformInstallationsDocument = `query GetTerraformInstallations ($id: } } } +fragment CrdFragment on Crd { + id + name + blob +} fragment TerraformInstallationFragment on TerraformInstallation { id terraform { @@ -3378,11 +3410,6 @@ fragment VersionFragment on Version { ... DependenciesFragment } } -fragment CrdFragment on Crd { - id - name - blob -} ` func (c *Client) GetTerraformInstallations(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*GetTerraformInstallations, error) { @@ -3403,6 +3430,16 @@ const UploadTerraformDocument = `mutation UploadTerraform ($repoName: String!, $ ... TerraformFragment } } +fragment TerraformFragment on Terraform { + id + name + package + description + dependencies { + ... DependenciesFragment + } + valuesTemplate +} fragment DependenciesFragment on Dependencies { dependencies { type @@ -3428,16 +3465,6 @@ fragment DependenciesFragment on Dependencies { outputs providerVsn } -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} ` func (c *Client) UploadTerraform(ctx context.Context, repoName string, name string, uploadOrURL string, httpRequestOptions ...client.HTTPRequestOption) (*UploadTerraform, error) { diff --git a/graph/cluster.graphql b/graph/cluster.graphql index 8c275b0..d24416d 100644 --- a/graph/cluster.graphql +++ b/graph/cluster.graphql @@ -26,3 +26,7 @@ mutation CreateDependency($sourceId: ID!, $destId: ID!) { mutation PromoteCluster { promote {...UserFragment} } + +mutation TransferOwnership($name: String!, $email: String!) { + transferOwnership(name: $name, email: $email) { id } +} \ No newline at end of file diff --git a/models_gen.go b/models_gen.go index 65fa47b..181afdf 100644 --- a/models_gen.go +++ b/models_gen.go @@ -299,6 +299,8 @@ type Cluster struct { Account *Account `json:"account"` // The URL of the console running on the cluster. ConsoleURL *string `json:"consoleUrl"` + // the dependencies a cluster has + Dependency ClusterDependency `json:"dependency"` // The domain name used for applications deployed on the cluster. Domain *string `json:"domain"` // The git repository URL for the cluster.