Documentation ¶
Index ¶
Constants ¶
View Source
const ( GlobalAccountIDParam = "account" SubAccountIDParam = "subaccount" InstanceIDParam = "instance_id" RuntimeIDParam = "runtime_id" RegionParam = "region" ShootParam = "shoot" PlanParam = "plan" StateParam = "state" OperationDetailParam = "op_detail" KymaConfigParam = "kyma_config" ClusterConfigParam = "cluster_config" ExpiredParam = "expired" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
ListRuntimes(params ListParameters) (RuntimesPage, error)
}
Client is the interface to interact with the KEB /runtimes API as an HTTP client using OIDC ID token in JWT format.
func NewClient ¶
NewClient constructs and returns new Client for KEB /runtimes API It takes the following arguments:
- url : base url of all KEB APIs, e.g. https://kyma-env-broker.kyma.local
- httpClient : underlying HTTP client used for API call to KEB
type ListParameters ¶
type ListParameters struct { // Page specifies the offset for the runtime results in the total count of matching runtimes Page int // PageSize specifies the count of matching runtimes returned in a response PageSize int // OperationDetail specifies whether the server should respond with all operations, or only the last operation. If not set, the server by default sends all operations OperationDetail OperationDetail // KymaConfig specifies whether kyma configuration details should be included in the response for each runtime KymaConfig bool // ClusterConfig specifies whether Gardener cluster configuration details should be included in the response for each runtime ClusterConfig bool // GlobalAccountIDs parameter filters runtimes by specified global account IDs GlobalAccountIDs []string // SubAccountIDs parameter filters runtimes by specified subaccount IDs SubAccountIDs []string // InstanceIDs parameter filters runtimes by specified instance IDs InstanceIDs []string // RuntimeIDs parameter filters runtimes by specified instance IDs RuntimeIDs []string // Regions parameter filters runtimes by specified provider regions Regions []string // Shoots parameter filters runtimes by specified shoot cluster names Shoots []string // Plans parameter filters runtimes by specified service plans Plans []string // States parameter filters runtimes by specified runtime states. See type State for possible values States []State // Expired parameter filters runtimes to show only expired ones. Expired bool // Events parameter fetches tracing events per instance Events string }
type Operation ¶
type Operation struct { State string `json:"state"` Type OperationType `json:"type,omitempty"` Description string `json:"description"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` OperationID string `json:"operationID"` OrchestrationID string `json:"orchestrationID,omitempty"` FinishedStages []string `json:"finishedStages"` ExecutedButNotCompletedSteps []string `json:"executedButNotCompletedSteps,omitempty"` RuntimeVersion string `json:"runtimeVersion"` }
type OperationDetail ¶
type OperationDetail string
const ( LastOperation OperationDetail = "last" AllOperation OperationDetail = "all" )
type OperationType ¶
type OperationType string
const ( Provision OperationType = "provision" Deprovision OperationType = "deprovision" UpgradeKyma OperationType = "kyma upgrade" UpgradeCluster OperationType = "cluster upgrade" Update OperationType = "update" Suspension OperationType = "suspension" Unsuspension OperationType = "unsuspension" )
type OperationsData ¶
type RuntimeDTO ¶
type RuntimeDTO struct { InstanceID string `json:"instanceID"` RuntimeID string `json:"runtimeID"` GlobalAccountID string `json:"globalAccountID"` SubscriptionGlobalAccountID string `json:"subscriptionGlobalAccountID"` SubAccountID string `json:"subAccountID"` ProviderRegion string `json:"region"` SubAccountRegion string `json:"subAccountRegion"` ShootName string `json:"shootName"` ServiceClassID string `json:"serviceClassID"` ServiceClassName string `json:"serviceClassName"` ServicePlanID string `json:"servicePlanID"` ServicePlanName string `json:"servicePlanName"` Provider string `json:"provider"` Status RuntimeStatus `json:"status"` UserID string `json:"userID"` AVSInternalEvaluationID int64 `json:"avsInternalEvaluationID"` KymaVersion string `json:"kymaVersion,omitempty"` KymaConfig *gqlschema.KymaConfigInput `json:"kymaConfig,omitempty"` ClusterConfig *gqlschema.GardenerConfigInput `json:"clusterConfig,omitempty"` }
func (RuntimeDTO) LastOperation ¶
func (rt RuntimeDTO) LastOperation() Operation
type RuntimeStatus ¶
type RuntimeStatus struct { CreatedAt time.Time `json:"createdAt"` ModifiedAt time.Time `json:"modifiedAt"` ExpiredAt *time.Time `json:"expiredAt,omitempty"` DeletedAt *time.Time `json:"deletedAt,omitempty"` State State `json:"state"` Provisioning *Operation `json:"provisioning,omitempty"` Deprovisioning *Operation `json:"deprovisioning,omitempty"` UpgradingKyma *OperationsData `json:"upgradingKyma,omitempty"` UpgradingCluster *OperationsData `json:"upgradingCluster,omitempty"` Update *OperationsData `json:"update,omitempty"` Suspension *OperationsData `json:"suspension,omitempty"` Unsuspension *OperationsData `json:"unsuspension,omitempty"` }
type RuntimesPage ¶
type RuntimesPage struct { Data []RuntimeDTO `json:"data"` Count int `json:"count"` TotalCount int `json:"totalCount"` }
type State ¶
type State string
const ( // StateSucceeded means that the last operation of the runtime has succeeded. StateSucceeded State = "succeeded" // StateFailed means that the last operation is one of provision, deprovivion, suspension, unsuspension, which has failed. StateFailed State = "failed" // StateError means the runtime is in a recoverable error state, due to the last upgrade/update operation has failed. StateError State = "error" // StateProvisioning means that the runtime provisioning (or unsuspension) is in progress (by the last runtime operation). StateProvisioning State = "provisioning" // StateDeprovisioning means that the runtime deprovisioning (or suspension) is in progress (by the last runtime operation). StateDeprovisioning State = "deprovisioning" // StateDeprovisioned means that the runtime deprovisioning has finished removing the instance. // In case the instance has already been deleted, KEB will try best effort to reconstruct at least partial information regarding deprovisioned instances from residual operations. StateDeprovisioned State = "deprovisioned" // StateDeprovisionIncomplete means that the runtime deprovisioning has finished removing the instance but certain steps have not finished and the instance should be requeued for repeated deprovisioning. StateDeprovisionIncomplete State = "deprovisionincomplete" // StateUpgrading means that kyma upgrade or cluster upgrade operation is in progress. StateUpgrading State = "upgrading" // StateUpdating means the runtime configuration is being updated (i.e. OIDC is reconfigured). StateUpdating State = "updating" // StateSuspended means that the trial runtime is suspended (i.e. deprovisioned). StateSuspended State = "suspended" // AllState is a virtual state only used as query parameter in ListParameters to indicate "include all runtimes, which are excluded by default without state filters". AllState State = "all" )
Click to show internal directories.
Click to hide internal directories.