diff --git a/client.go b/client.go index 96a2dfd..a68f0cd 100644 --- a/client.go +++ b/client.go @@ -613,6 +613,11 @@ type CreateDomain struct { type CreateEvent struct { CreateUserEvent *bool "json:\"createUserEvent\" graphql:\"createUserEvent\"" } +type CreateInstallation struct { + CreateInstallation *struct { + ID string "json:\"id\" graphql:\"id\"" + } "json:\"createInstallation\" graphql:\"createInstallation\"" +} type CreateIntegration struct { CreateIntegration *struct { ID string "json:\"id\" graphql:\"id\"" @@ -1415,6 +1420,26 @@ func (c *Client) CreateEvent(ctx context.Context, attrs UserEventAttributes, htt return &res, nil } +const CreateInstallationDocument = `mutation CreateInstallation ($id: ID!) { + createInstallation(repositoryId: $id) { + id + } +} +` + +func (c *Client) CreateInstallation(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*CreateInstallation, error) { + vars := map[string]interface{}{ + "id": id, + } + + var res CreateInstallation + if err := c.Client.Post(ctx, "CreateInstallation", CreateInstallationDocument, &res, vars, httpRequestOptions...); err != nil { + return nil, err + } + + return &res, nil +} + const CreateIntegrationDocument = `mutation CreateIntegration ($name: String!, $attrs: IntegrationAttributes!) { createIntegration(repositoryName: $name, attributes: $attrs) { id diff --git a/graph/installations.graphql b/graph/installations.graphql index 386f3ca..8d53a02 100644 --- a/graph/installations.graphql +++ b/graph/installations.graphql @@ -26,6 +26,10 @@ mutation ResetInstallations(){ resetInstallations } +mutation CreateInstallation($id: ID!) { + createInstallation(repositoryId: $id) { id } +} + mutation DeleteInstallation($id: ID!) { deleteInstallation(id: $id) { id } } diff --git a/models_gen.go b/models_gen.go index be2b493..45c0642 100644 --- a/models_gen.go +++ b/models_gen.go @@ -326,6 +326,12 @@ type Cluster struct { PingedAt *string `json:"pingedAt"` // pending upgrades for each installed app UpgradeInfo []*UpgradeInfo `json:"upgradeInfo"` + // whether all installations in the cluster have been synced + Synced *bool `json:"synced"` + // whether any installation in the cluster has been locked + Locked *bool `json:"locked"` + // CPU/Memory history for this cluster + UsageHistory []*ClusterUsageHistory `json:"usageHistory"` // the dependencies a cluster has Dependency *ClusterDependency `json:"dependency"` // The user that owns the cluster. @@ -390,6 +396,16 @@ type ClusterInformationAttributes struct { Platform *string `json:"platform,omitempty"` } +// A record of the utilization in a given cluster +type ClusterUsageHistory struct { + CPU *int64 `json:"cpu"` + Memory *int64 `json:"memory"` + Cluster *Cluster `json:"cluster"` + Account *Account `json:"account"` + InsertedAt *string `json:"insertedAt"` + UpdatedAt *string `json:"updatedAt"` +} + type Community struct { Discord *string `json:"discord"` Slack *string `json:"slack"` @@ -1547,6 +1563,7 @@ type PlanFeatures struct { UserManagement *bool `json:"userManagement"` Audit *bool `json:"audit"` DatabaseManagement *bool `json:"databaseManagement"` + Cd *bool `json:"cd"` } type PlanLineItemAttributes struct { diff --git a/schema/schema.graphql b/schema/schema.graphql index 2ffda33..5831a70 100644 --- a/schema/schema.graphql +++ b/schema/schema.graphql @@ -547,6 +547,7 @@ type PlanFeatures { userManagement: Boolean audit: Boolean databaseManagement: Boolean + cd: Boolean } type PlatformSubscriptionLineItems { @@ -1582,6 +1583,15 @@ type Cluster { "pending upgrades for each installed app" upgradeInfo: [UpgradeInfo] + "whether all installations in the cluster have been synced" + synced: Boolean + + "whether any installation in the cluster has been locked" + locked: Boolean + + "CPU\/Memory history for this cluster" + usageHistory(begin: DateTime!): [ClusterUsageHistory] + "the dependencies a cluster has" dependency: ClusterDependency @@ -2159,6 +2169,16 @@ type Stack { updatedAt: DateTime } +"A record of the utilization in a given cluster" +type ClusterUsageHistory { + cpu: Int + memory: Int + cluster: Cluster + account: Account + insertedAt: DateTime + updatedAt: DateTime +} + type Community { discord: String slack: String @@ -2425,19 +2445,19 @@ type UpgradePath { type: ValueType! } -type RoleBinding { +type VersionTag { id: ID! - user: User - group: Group + tag: String! + version: Version + chart: Chart insertedAt: DateTime updatedAt: DateTime } -type VersionTag { +type RoleBinding { id: ID! - tag: String! - version: Version - chart: Chart + user: User + group: Group insertedAt: DateTime updatedAt: DateTime }