Documentation
¶
Index ¶
- Constants
- func ConvertHTTPError(httperrcode int) error
- func ConvertToHTTPError(err error) (errmsg string, errcode int)
- func CreateConfigFile(ctx context.Context, dbIns db.DB, cfgfile *common.ConfigFile, requuid string) (*common.ConfigFile, error)
- type CatalogCheckServiceInitRequest
- type CatalogCheckServiceInitResponse
- type CatalogConsulOptions
- type CatalogCouchDBOptions
- type CatalogCreateCassandraRequest
- type CatalogCreateConsulRequest
- type CatalogCreateConsulResponse
- type CatalogCreateCouchDBRequest
- type CatalogCreateElasticSearchRequest
- type CatalogCreateKafkaRequest
- type CatalogCreateKibanaRequest
- type CatalogCreateLogstashRequest
- type CatalogCreateMongoDBRequest
- type CatalogCreatePostgreSQLRequest
- type CatalogCreateRedisRequest
- type CatalogCreateZooKeeperRequest
- type CatalogElasticSearchOptions
- type CatalogKibanaOptions
- type CatalogLogstashOptions
- type CatalogPostgreSQLOptions
- type CatalogRedisOptions
- type CatalogSetRedisInitRequest
- type CatalogSetServiceInitRequest
- type CreateServiceRequest
- type DeleteTaskRequest
- type GetConfigFileRequest
- type GetConfigFileResponse
- type GetServiceAttributesResponse
- type GetServiceStatusResponse
- type GetTaskStatusRequest
- type GetTaskStatusResponse
- type InternalGetServiceTaskRequest
- type InternalGetServiceTaskResponse
- type InternalListActiveServiceTasksRequest
- type InternalListActiveServiceTasksResponse
- type ListServiceMemberRequest
- type ListServiceMemberResponse
- type ListServiceRequest
- type ListServiceResponse
- type ReplicaConfig
- type ReplicaConfigFile
- type RunTaskRequest
- type RunTaskResponse
- type ServiceCommonRequest
Constants ¶
const ( // special service operations SpecialOpPrefix = "?" ListServiceOp = SpecialOpPrefix + "List-Service" ListServiceMemberOp = SpecialOpPrefix + "List-ServiceMember" GetConfigFileOp = SpecialOpPrefix + "Get-Config-File" GetServiceStatusOp = SpecialOpPrefix + "Get-Service-Status" ServiceInitializedOp = SpecialOpPrefix + "Set-Service-Initialized" RunTaskOp = SpecialOpPrefix + "Run-Task" GetTaskStatusOp = SpecialOpPrefix + "Get-Task-Status" DeleteTaskOp = SpecialOpPrefix + "Delete-Task" CatalogOpPrefix = SpecialOpPrefix + "Catalog-" CatalogCreateMongoDBOp = CatalogOpPrefix + "Create-MongoDB" CatalogCreatePostgreSQLOp = CatalogOpPrefix + "Create-PostgreSQL" CatalogCreateCassandraOp = CatalogOpPrefix + "Create-Cassandra" CatalogCreateZooKeeperOp = CatalogOpPrefix + "Create-ZooKeeper" CatalogCreateKafkaOp = CatalogOpPrefix + "Create-Kafka" CatalogCreateRedisOp = CatalogOpPrefix + "Create-Redis" CatalogCreateCouchDBOp = CatalogOpPrefix + "Create-CouchDB" CatalogCreateConsulOp = CatalogOpPrefix + "Create-Consul" CatalogCreateElasticSearchOp = CatalogOpPrefix + "Create-ElasticSearch" CatalogCreateKibanaOp = CatalogOpPrefix + "Create-Kibana" CatalogCreateLogstashOp = CatalogOpPrefix + "Create-Logstash" CatalogCheckServiceInitOp = CatalogOpPrefix + "Check-Service-Init" CatalogSetServiceInitOp = CatalogOpPrefix + "Set-Service-Init" CatalogSetRedisInitOp = CatalogOpPrefix + "Set-Redis-Init" InternalOpPrefix = SpecialOpPrefix + "Internal-" InternalGetServiceTaskOp = InternalOpPrefix + "GetServiceTask" InternalListActiveServiceTasksOp = InternalOpPrefix + "ListActiveServiceTasks" // response headers RequestID = "x-RequestId" Server = "Server" ContentType = "Content-Type" JsonContentType = "application/json" )
Variables ¶
This section is empty.
Functions ¶
func ConvertHTTPError ¶
func ConvertToHTTPError ¶
func CreateConfigFile ¶
func CreateConfigFile(ctx context.Context, dbIns db.DB, cfgfile *common.ConfigFile, requuid string) (*common.ConfigFile, error)
Types ¶
type CatalogCheckServiceInitRequest ¶
type CatalogCheckServiceInitRequest struct {
ServiceType string
Service *ServiceCommonRequest
Admin string
AdminPasswd string
// Redis specific fields.
// TODO they should be moved to ServiceAttr.UserData.
Shards int64
ReplicasPerShard int64
}
CatalogCheckServiceInitRequest checks whether one catalog service is initialized.
type CatalogCheckServiceInitResponse ¶
CatalogCheckServiceInitResponse returns the service init status
type CatalogConsulOptions ¶ added in v0.8.1
type CatalogConsulOptions struct {
Replicas int64
VolumeSizeGB int64
// https://www.consul.io/docs/agent/options.html#_datacenter
// if not specified, use the current Region.
Datacenter string
// https://www.consul.io/docs/agent/options.html#_domain
Domain string
// https://www.consul.io/docs/agent/options.html#_encrypt
// This key must be 16-bytes that are Base64-encoded.
Encrypt string
// TLS configs
EnableTLS bool
CertFileContent string
KeyFileContent string
CACertFileContent string
HTTPSPort int64
}
CatalogConsulOptions includes the config options for Consul.
type CatalogCouchDBOptions ¶ added in v0.8.1
type CatalogCouchDBOptions struct {
Replicas int64
VolumeSizeGB int64
// CouchDB admin username and password
Admin string
AdminPasswd string
// CouchDB Cors configs
EnableCors bool
Credentials bool
Origins string
Headers string
Methods string
// CouchDB SSL configs
EnableSSL bool
CertFileContent string
KeyFileContent string
CACertFileContent string
}
CatalogCouchDBOptions includes the config options for CouchDB.
type CatalogCreateCassandraRequest ¶
type CatalogCreateCassandraRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Replicas int64
VolumeSizeGB int64
}
CatalogCreateCassandraRequest creates a Cassandra service.
type CatalogCreateConsulRequest ¶ added in v0.8.1
type CatalogCreateConsulRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Options *CatalogConsulOptions
}
CatalogCreateConsulRequest creates a Consul service.
type CatalogCreateConsulResponse ¶ added in v0.8.1
type CatalogCreateConsulResponse struct {
ConsulServerIPs []string
}
CatalogCreateConsulResponse returns the consul server ips.
type CatalogCreateCouchDBRequest ¶ added in v0.8.1
type CatalogCreateCouchDBRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Options *CatalogCouchDBOptions
}
CatalogCreateCouchDBRequest creates a CouchDB service.
type CatalogCreateElasticSearchRequest ¶ added in v0.8.1
type CatalogCreateElasticSearchRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Options *CatalogElasticSearchOptions
}
CatalogCreateElasticSearchRequest creates an ElasticSearch service.
type CatalogCreateKafkaRequest ¶
type CatalogCreateKafkaRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Replicas int64
VolumeSizeGB int64
AllowTopicDel bool
RetentionHours int64
// the existing ZooKeeper service that Kafka will use.
ZkServiceName string
}
CatalogCreateKafkaRequest creates a Kafka service.
type CatalogCreateKibanaRequest ¶ added in v0.8.1
type CatalogCreateKibanaRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Options *CatalogKibanaOptions
}
CatalogCreateKibanaRequest creates an Kibana service.
type CatalogCreateLogstashRequest ¶ added in v0.8.1
type CatalogCreateLogstashRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Options *CatalogLogstashOptions
}
CatalogCreateLogstashRequest creates a Logstash service.
type CatalogCreateMongoDBRequest ¶
type CatalogCreateMongoDBRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Replicas int64
VolumeSizeGB int64
Admin string
AdminPasswd string
}
CatalogCreateMongoDBRequest creates a MongoDB ReplicaSet service.
type CatalogCreatePostgreSQLRequest ¶
type CatalogCreatePostgreSQLRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Options *CatalogPostgreSQLOptions
}
CatalogCreatePostgreSQLRequest creates a PostgreSQL service.
type CatalogCreateRedisRequest ¶
type CatalogCreateRedisRequest struct {
Service *ServiceCommonRequest
// Resources.MaxMemoryMB should always be set.
// if cluster mode is enabled (Shards >= 3), the actual redis memory will be
// Resources.MaxMemoryMB - default output buffer for the slaves (512MB).
Resource *common.Resources
Options *CatalogRedisOptions
}
CatalogCreateRedisRequest creates a Redis service.
type CatalogCreateZooKeeperRequest ¶
type CatalogCreateZooKeeperRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
Replicas int64
VolumeSizeGB int64
}
CatalogCreateZooKeeperRequest creates a ZooKeeper service.
type CatalogElasticSearchOptions ¶ added in v0.8.1
type CatalogElasticSearchOptions struct {
Replicas int64
VolumeSizeGB int64
DedicatedMasters int64
DisableDedicatedMaster bool
DisableForceAwareness bool
}
CatalogElasticSearchOptions includes the config options for ElasticSearch.
type CatalogKibanaOptions ¶ added in v0.8.1
type CatalogKibanaOptions struct {
Replicas int64
VolumeSizeGB int64
// the ElasticSearch service that Kibana is used for
ESServiceName string
// specify a path to mount Kibana at if you are running behind a proxy.
// This only affects the URLs generated by Kibana, your proxy is expected to remove the
// basePath value before forwarding requests to Kibana. This setting cannot end in a slash (/).
ProxyBasePath string
EnableSSL bool
SSLKey string
SSLCert string
}
CatalogKibanaOptions includes the config options for Kibana.
type CatalogLogstashOptions ¶ added in v0.8.1
type CatalogLogstashOptions struct {
Replicas int64
VolumeSizeGB int64
// The container image for the service, such as cloudstax/firecamp-logstash:version or cloudstax/firecamp-logstash-input-couchdb:version
ContainerImage string
// The internal queue model: "memory" or "persisted"
QueueType string
EnableDeadLetterQueue bool
// The pipeline configs.
// There is no need to have multiple config file, as Logstash currently has a single event pipeline.
// All configuration files are just concatenated (in order) as if you had written a single flat file.
PipelineConfigs string
// https://www.elastic.co/guide/en/logstash/5.6/tuning-logstash.html
// The pipeline settings
PipelineWorkers int
PipelineOutputWorkers int
PipelineBatchSize int
PipelineBatchDelay int
}
CatalogLogstashOptions includes the config options for Logstash.
type CatalogPostgreSQLOptions ¶ added in v0.8.1
type CatalogPostgreSQLOptions struct {
Replicas int64
VolumeSizeGB int64
// The container image for the service, such as cloudstax/firecamp-postgres:version or cloudstax/firecamp-postgres-postgis:version
ContainerImage string
// the default admin user is: postgres
AdminPasswd string
ReplUser string
ReplUserPasswd string
}
CatalogPostgreSQLOptions includes the config options for PostgreSQL.
type CatalogRedisOptions ¶
type CatalogRedisOptions struct {
// The number of shards for Redis cluster, minimal 3.
// Setting to 1 will disable cluster mode. 2 is invalid.
Shards int64
ReplicasPerShard int64
VolumeSizeGB int64
// whether disable Redis "append only file", not recommended unless for cache only.
DisableAOF bool
// The AUTH password, recommended to set it for production environment. Empty string means disable it.
AuthPass string
// minimal 60s, not recommend to change unless necessary. see Redis Readme for details.
ReplTimeoutSecs int64
// how Redis will select what to remove when maxmemory is reached
MaxMemPolicy string
// rename the CONFIG command
ConfigCmdName string
}
CatalogRedisOptions includes the config options for Redis.
type CatalogSetRedisInitRequest ¶
type CatalogSetRedisInitRequest struct {
Region string
Cluster string
ServiceName string
// The Redis node ids, format: "MemberName RedisNodeID Role(master/slave)"
NodeIds []string
}
CatalogSetRedisInitRequest sets the redis service initialized. This is an internal request sent from the service's init task. It should not be called directly by the application.
type CatalogSetServiceInitRequest ¶
type CatalogSetServiceInitRequest struct {
Region string
Cluster string
ServiceName string
ServiceType string
}
CatalogSetServiceInitRequest sets the catalog service initialized. This is an internal request sent from the service's init task. It should not be called directly by the application.
type CreateServiceRequest ¶
type CreateServiceRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
ContainerImage string
Replicas int64
VolumeSizeGB int64
ContainerPath string // The mount path inside container
PortMappings []common.PortMapping
Envkvs []*common.EnvKeyValuePair
RegisterDNS bool
RequireStaticIP bool
ReplicaConfigs []*ReplicaConfig
}
CreateServiceRequest contains the parameters for creating a service. Currently every replica should have its own ReplicaConfig. This aims to provide the flexibility for different services. CreateService simply returns success or not.
type DeleteTaskRequest ¶
type DeleteTaskRequest struct {
Service *ServiceCommonRequest
TaskType string
}
DeleteTaskRequest deletes the service task.
type GetConfigFileRequest ¶
GetConfigFileRequest gets one config file.
type GetConfigFileResponse ¶
type GetConfigFileResponse struct {
ConfigFile *common.ConfigFile
}
GetConfigFileResponse rturns the config file.
type GetServiceAttributesResponse ¶
type GetServiceAttributesResponse struct {
Service *common.ServiceAttr
}
GetServiceAttributesResponse returns the service's attributes. GetServiceAttributesRequest just sends a "GET" with ServiceCommonRequest.
type GetServiceStatusResponse ¶
type GetServiceStatusResponse struct {
Status *common.ServiceStatus
}
GetServiceStatusResponse returns the service's status. GetServiceStatusRequest just sends a "GET" with ServiceCommonRequest.
type GetTaskStatusRequest ¶
type GetTaskStatusRequest struct {
Service *ServiceCommonRequest
TaskID string
}
GetTaskStatusRequest gets the task status for the task of one service.
type GetTaskStatusResponse ¶
type GetTaskStatusResponse struct {
Status *common.TaskStatus
}
GetTaskStatusResponse returns the task status.
type InternalGetServiceTaskRequest ¶
type InternalGetServiceTaskRequest struct {
Region string
Cluster string
ServiceName string
ContainerInstanceID string
}
InternalGetServiceTaskRequest gets the service task from the container framework.
type InternalGetServiceTaskResponse ¶
type InternalGetServiceTaskResponse struct {
ServiceTaskID string
}
InternalGetServiceTaskResponse returns the service task ID.
type InternalListActiveServiceTasksRequest ¶
type InternalListActiveServiceTasksRequest struct {
Region string
Cluster string
ServiceName string
}
InternalListActiveServiceTasksRequest gets the service active tasks from the container framework.
type InternalListActiveServiceTasksResponse ¶
InternalListActiveServiceTasksResponse returns the active task IDs of the service.
type ListServiceMemberRequest ¶
type ListServiceMemberRequest struct {
Service *ServiceCommonRequest
}
ListServiceMemberRequest lists the serviceMembers of one service
type ListServiceMemberResponse ¶
type ListServiceMemberResponse struct {
ServiceMembers []*common.ServiceMember
}
ListServiceMemberResponse returns the serviceMembers of one service
type ListServiceRequest ¶
type ListServiceRequest struct {
// region, az and cluster are for the management service to verify
// the request is sent to the correct server
Region string
Cluster string
// The prefix of the service name
Prefix string
}
ListServiceRequest lists the services according to the filter. TODO change "Prefix" to the common filter.
type ListServiceResponse ¶
type ListServiceResponse struct {
Services []*common.ServiceAttr
}
ListServiceResponse returns all listed services' attributes.
type ReplicaConfig ¶
type ReplicaConfig struct {
// The availability zone this replica should run.
Zone string
// The detail config files for this replica.
Configs []*ReplicaConfigFile
}
ReplicaConfig contains the required config files for one replica.
type ReplicaConfigFile ¶
ReplicaConfigFile contains the detail config file name and content.
type RunTaskRequest ¶
type RunTaskRequest struct {
Service *ServiceCommonRequest
Resource *common.Resources
ContainerImage string
TaskType string
Envkvs []*common.EnvKeyValuePair
}
RunTaskRequest contains the parameters to run a task.
type RunTaskResponse ¶
type RunTaskResponse struct {
TaskID string
}
RunTaskResponse returns the TaskID for the task.
type ServiceCommonRequest ¶
ServiceCommonRequest contains the common service parameters. region and cluster are for the management service to verify the request is sent to the correct server.