grpcapi

package
v0.47.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	apiservice.UnimplementedAPIServiceServer
	// contains filtered or unexported fields
}

API implements the behaviors for the gRPC definitions of API.

func NewAPI

func NewAPI(
	ctx context.Context,
	ds datastore.DataStore,
	fs filestore.Store,
	sc cache.Cache,
	cog commandOutputGetter,
	psc cache.Cache,
	webBaseURL string,
	logger *zap.Logger,
) *API

NewAPI creates a new API instance.

func (*API) DeleteApplication added in v0.39.0

func (*API) DisableApplication added in v0.41.3

func (*API) EnableApplication added in v0.43.0

func (*API) Encrypt

func (*API) GetPiped added in v0.44.0

func (*API) ListApplications

ListApplications returns the application list of the project where the caller belongs to. Currently, the maximum number of returned applications per request is set to 10. The response contains a "cursor" value, which should be passed in the next request in order to get the next 10 applications. If the cursor is not provided in the request, only 10 latest applications will be returned.

func (*API) ListDeployments added in v0.42.0

func (*API) ListStageLogs added in v0.42.0

func (*API) Register

func (a *API) Register(server *grpc.Server)

Register registers all handling of this service into the specified gRPC server.

func (*API) RegisterPiped added in v0.44.0

func (*API) UpdateApplication added in v0.44.0

func (*API) UpdatePiped added in v0.44.0

type PipedAPI

type PipedAPI struct {
	pipedservice.UnimplementedPipedServiceServer
	// contains filtered or unexported fields
}

PipedAPI implements the behaviors for the gRPC definitions of PipedAPI.

func NewPipedAPI

func NewPipedAPI(ctx context.Context, ds datastore.DataStore, sc cache.Cache, sls stagelogstore.Store, alss applicationlivestatestore.Store, las analysisresultstore.Store, hc cache.Cache, cop commandOutputPutter, uas unregisteredappstore.Store, webBaseURL string, logger *zap.Logger) *PipedAPI

NewPipedAPI creates a new PipedAPI instance.

func (*PipedAPI) CreateDeployment

CreateDeployment creates/triggers a new deployment for an application that is managed by this piped. This will be used by DeploymentTrigger component.

func (*PipedAPI) CreateDeploymentChain

CreateDeploymentChain creates a new deployment chain object and all required commands to trigger deployment for applications in the chain.

func (*PipedAPI) GetApplicationMostRecentDeployment

GetApplicationMostRecentDeployment returns the most recent deployment of the given application.

func (*PipedAPI) GetLatestEvent

GetLatestEvent returns the latest event that meets the given conditions.

func (*PipedAPI) InChainDeploymentPlannable

InChainDeploymentPlannable hecks the completion and status of the previous block in the deployment chain. An in chain deployment is treated as plannable in case: - It's the first deployment of its deployment chain. - All deployments of its previous block in chain are at DEPLOYMENT_SUCCESS state. In case the previous block is finished with unsuccessfully status, cancelled flag will be returned so that the in charge piped will be aware and stop that deployment.

func (*PipedAPI) ListApplications

ListApplications returns a list of registered applications that should be managed by the requested piped. Disabled applications should not be included in the response. Piped uses this RPC to fetch and sync the application configuration into its local database.

func (*PipedAPI) ListEvents

ListEvents returns a list of Events inside the given range.

func (*PipedAPI) ListNotCompletedDeployments

ListNotCompletedDeployments returns a list of not completed deployments which are managed by this piped. DeploymentController component uses this RPC to spawns/syncs its local deployment executors.

func (*PipedAPI) ListUnhandledCommands

ListUnhandledCommands is periodically called by piped to obtain the commands that should be handled. Whenever an user makes an interaction from WebUI (cancel/approve/retry/sync) a new command with a unique identifier will be generated an saved into the datastore. Piped uses this RPC to list all still-not-handled commands to handle them, then report back the result to server. On other side, the web will periodically check the command status and feedback the result to user. In the future, we may need a solution to remove all old-handled commands from datastore for space.

func (*PipedAPI) Register

func (a *PipedAPI) Register(server *grpc.Server)

Register registers all handling of this service into the specified gRPC server.

func (*PipedAPI) ReportApplicationDeployingStatus

ReportApplicationDeployingStatus is used to report whether the specified application is deploying or not.

func (*PipedAPI) ReportApplicationLiveState

ReportApplicationLiveState is periodically sent to correct full state of an application. For kubernetes application, this contains a full tree of its kubernetes resources. The tree data should be written into filestore immediately and then the state in cache should be refreshsed too.

func (*PipedAPI) ReportApplicationLiveStateEvents

ReportApplicationLiveStateEvents is sent by piped to submit one or multiple events about the changes of application state. Control plane uses the received events to update the state of application-resource-tree. We want to start by a simple solution at this initial stage of development, so the API server just handles as below: - loads the related application-resource-tree from filestore - checks and builds new state for the application-resource-tree - updates new state into fielstore and cache (cache data is for reading while handling web requests) In the future, we may want to redesign the behavior of this RPC by using pubsub/queue pattern. After receiving the events, all of them will be publish into a queue immediately, and then another Handler service will pick them inorder to apply to build new state. By that way we can control the traffic to the datastore in a better way.

func (*PipedAPI) ReportApplicationMostRecentDeployment

ReportApplicationMostRecentDeployment is used to update the basic information about the most recent deployment of a specific application.

func (*PipedAPI) ReportApplicationSyncState

ReportApplicationSyncState is used to update the sync status of an application.

func (*PipedAPI) ReportCommandHandled

ReportCommandHandled is called by piped to mark a specific command as handled. The request payload will contain the handle status as well as any additional result data. The handle result should be updated to both datastore and cache (for reading from web).

func (*PipedAPI) ReportDeploymentCompleted

ReportDeploymentCompleted used by piped to update the status of a specific deployment to SUCCESS | FAILURE | CANCELLED.

func (*PipedAPI) ReportDeploymentPlanned

ReportDeploymentPlanned used by piped to update the status of a specific deployment to PLANNED.

func (*PipedAPI) ReportDeploymentStatusChanged

ReportDeploymentStatusChanged is used to update the status of a specific deployment to RUNNING or ROLLING_BACK.

func (*PipedAPI) ReportEventStatuses added in v0.24.1

func (*PipedAPI) ReportEventsHandled

Deprecated. This is only for the old Piped agents.

func (*PipedAPI) ReportPipedMeta

ReportPipedMeta is sent by piped while starting up to report its metadata such as configured cloud providers.

func (*PipedAPI) ReportStageLogs

ReportStageLogs is sent by piped to save the log of a pipeline stage.

func (*PipedAPI) ReportStageLogsFromLastCheckpoint

ReportStageLogsFromLastCheckpoint is used to save the full logs from the most recently saved point.

func (*PipedAPI) ReportStageStatusChanged

ReportStageStatusChanged used by piped to update the status of a specific stage of a deployment.

func (*PipedAPI) ReportStat

ReportStat is periodically sent to report its realtime status/stats to control-plane. The received stats will be pushed to the metrics collector.

func (*PipedAPI) SaveDeploymentMetadata

SaveDeploymentMetadata used by piped to persist the metadata of a specific deployment.

func (*PipedAPI) SaveStageMetadata

SaveStageMetadata used by piped to persist the metadata of a specific stage of a deployment.

type WebAPI

type WebAPI struct {
	webservice.UnimplementedWebServiceServer
	// contains filtered or unexported fields
}

WebAPI implements the behaviors for the gRPC definitions of WebAPI.

func NewWebAPI

NewWebAPI creates a new WebAPI instance.

func (*WebAPI) AddProjectRBACRole added in v0.28.0

func (*WebAPI) AddProjectUserGroup added in v0.28.0

func (*WebAPI) DeleteProjectRBACRole added in v0.28.0

func (*WebAPI) DeleteProjectUserGroup added in v0.28.0

func (*WebAPI) DisableStaticAdmin

DisableStaticAdmin disables static admin login.

func (*WebAPI) EnableStaticAdmin

EnableStaticAdmin enables static admin login.

func (*WebAPI) GetCommand

func (*WebAPI) GetInsightData

GetInsightData returns the accumulated insight data.

func (*WebAPI) GetMe

GetMe gets information about the current user.

func (*WebAPI) GetPiped

func (*WebAPI) GetProject

GetProject gets the specified porject without sensitive data.

func (*WebAPI) ListEvents added in v0.24.1

func (*WebAPI) ListPipeds

func (*WebAPI) ListReleasedVersions added in v0.33.0

func (*WebAPI) Register

func (a *WebAPI) Register(server *grpc.Server)

Register registers all handling of this service into the specified gRPC server.

func (*WebAPI) RestartPiped added in v0.33.0

func (*WebAPI) SkipStage added in v0.27.4

func (*WebAPI) UpdateProjectRBACConfig

UpdateProjectRBACConfig updates the sso settings.

func (*WebAPI) UpdateProjectRBACRole added in v0.28.0

func (*WebAPI) UpdateProjectSSOConfig

UpdateProjectSSOConfig updates the sso settings.

func (*WebAPI) UpdateProjectStaticAdmin

UpdateProjectStaticAdmin updates the static admin user settings.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL