houston

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 14 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AuthConfigGetRequest = `` /* 198-byte string literal not displayed */

	DeploymentCreateRequest = `` /* 438-byte string literal not displayed */

	DeploymentDeleteRequest = `` /* 227-byte string literal not displayed */

	DeploymentsGetRequest = `` /* 316-byte string literal not displayed */

	DeploymentUpdateRequest = `` /* 335-byte string literal not displayed */

	ServiceAccountCreateRequest = `` /* 421-byte string literal not displayed */

	CreateDeploymentServiceAccountRequest = `` /* 431-byte string literal not displayed */

	CreateWorkspaceServiceAccountRequest = `` /* 388-byte string literal not displayed */

	DeploymentServiceAccountDeleteRequest = `` /* 376-byte string literal not displayed */

	WorkspaceServiceAccountDeleteRequest = `` /* 400-byte string literal not displayed */

	ServiceAccountsGetRequest = `` /* 342-byte string literal not displayed */

	TokenBasicCreateRequest = `` /* 246-byte string literal not displayed */

	UserCreateRequest = `` /* 328-byte string literal not displayed */

	WorkspacesGetRequest = `` /* 217-byte string literal not displayed */

	WorkspaceCreateRequest = `` /* 200-byte string literal not displayed */

	WorkspaceDeleteRequest = `` /* 135-byte string literal not displayed */

	WorkspaceUpdateRequest = `` /* 197-byte string literal not displayed */

	WorkspaceUserAddRequest = `` /* 307-byte string literal not displayed */

	WorkspaceUserUpdateRequest = `` /* 219-byte string literal not displayed */

	WorkspaceUserRemoveRequest = `` /* 266-byte string literal not displayed */

	DeploymentLogsGetRequest = `` /* 275-byte string literal not displayed */

	DeploymentLogsSubscribeRequest = `` /* 317-byte string literal not displayed */

	DeploymentInfoRequest = `
	query DeploymentInfo {
		deploymentConfig {
			airflowImages {
				version
				tag
		}
		defaultAirflowImageTag
		}
	}`
	AppConfigRequest = `
	query AppConfig {
		appConfig {
			version
			baseDomain
			smtpConfigured
			manualReleaseNames
		}
	}`
)
View Source
var PermissionsError = errors.New("You do not have the appropriate permissions for that")

Functions

func BuildDeploymentLogsSubscribeRequest added in v0.9.0

func BuildDeploymentLogsSubscribeRequest(deploymentId, component, search string, timestamp time.Time) (string, error)

func Subscribe added in v0.9.0

func Subscribe(jwtToken, url, queryMessage string) error

Types

type AirflowImage added in v0.11.0

type AirflowImage struct {
	Version string `json:"version"`
	Tag     string `json:"tag"`
}

AirflowImage contains all airflow image attributes

type AppConfig added in v0.15.0

type AppConfig struct {
	Version            string `json:"version"`
	BaseDomain         string `json:"baseDomain"`
	SmtpConfigured     bool   `json:"smtpConfigured"`
	ManualReleaseNames bool   `json:"manualReleaseNames"`
}

AppConfig contains current houston config

type AuthConfig added in v0.2.0

type AuthConfig struct {
	LocalEnabled  bool           `json:"localEnabled"`
	PublicSignup  bool           `json:"publicSignup"`
	InitialSignup bool           `json:"initialSignup"`
	AuthProviders []AuthProvider `json:"providers"`
}

AuthConfig holds data related to oAuth and basic authentication

type AuthPayload added in v0.9.0

type AuthPayload struct {
	Authorization string `json:"authorization"`
}

type AuthProvider added in v0.9.5

type AuthProvider struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Url         string `json:"url"`
}

type AuthUser added in v0.2.0

type AuthUser struct {
	User  User  `json:"user"`
	Token Token `json:"token"`
}

type Client

type Client struct {
	HTTPClient *httputil.HTTPClient
}

Client containers the logger and HTTPClient used to communicate with the HoustonAPI

func NewHoustonClient

func NewHoustonClient(c *httputil.HTTPClient) *Client

NewHoustonClient returns a new Client with the logger and HTTP client setup.

func (*Client) Do added in v0.7.0

func (c *Client) Do(doOpts httputil.DoOptions) (*Response, error)

Do executes a query against the Houston API, logging out any errors contained in the response object

type Decoded

type Decoded struct {
	ID  string `json:"id"`
	SU  bool   `json:"sU"`
	Iat int    `json:"iat"`
	Exp int    `json:"exp"`
}

Decoded defines structure of a houston response Decoded object

type Deployment

type Deployment struct {
	Id             string          `json:"id"`
	Type           string          `json:"type"`
	Label          string          `json:"label"`
	ReleaseName    string          `json:"releaseName"`
	Version        string          `json:"version"`
	DeploymentInfo DeploymentInfo  `json:"deployInfo"`
	Workspace      Workspace       `json:"workspace"`
	Urls           []DeploymentUrl `json:"urls"`
	CreatedAt      string          `json:"createdAt"`
	UpdatedAt      string          `json:"updatedAt"`
}

Deployment defines structure of a houston response Deployment object

type DeploymentConfig added in v0.11.0

type DeploymentConfig struct {
	AirflowImages          []AirflowImage `json:"airflowImages"`
	DefaultAirflowImageTag string         `json:"defaultAirflowImageTag"`
}

DeploymentConfig contains current airflow image tag

func (*DeploymentConfig) GetValidTags added in v0.11.0

func (config *DeploymentConfig) GetValidTags(tag string) (tags []string)

func (*DeploymentConfig) IsValidTag added in v0.11.0

func (config *DeploymentConfig) IsValidTag(tag string) bool

type DeploymentInfo added in v0.2.0

type DeploymentInfo struct {
	NextCli string `json:"NextCli"`
	Current string `json:"current"`
}

DeploymentInfo contains registry related information for a deployment

type DeploymentLog added in v0.9.0

type DeploymentLog struct {
	Id        string `json:"id"`
	Component string `json:"component"`
	CreatedAt string `json:"createdAt"`
	Log       string `json:"log"`
}

DeploymentLog contains all log related to deployment components

type DeploymentServiceAccount added in v0.10.3

type DeploymentServiceAccount struct {
	Id             string `json:"id"`
	ApiKey         string `json:"apiKey"`
	Label          string `json:"label"`
	Category       string `json:"category"`
	EntityType     string `json:"entityType"`
	DeploymentUuid string `json:"deploymentUuid"`
	LastUsedAt     string `json:"lastUsedAt"`
	CreatedAt      string `json:"createdAt"`
	UpdatedAt      string `json:"updatedAt"`
	Active         bool   `json:"active"`
}

DeploymentServiceAccount defines a structure of a DeploymentServiceAccountResponse object

type DeploymentUrl added in v0.12.0

type DeploymentUrl struct {
	Type string `json:"type"`
	Url  string `json:"url"`
}

DeploymentUrl defines structure of a houston response DeploymentUrl object

type Email added in v0.2.0

type Email struct {
	Address  string `json:"address"`
	Verified bool   `json:"verified"`
	Primary  bool   `json:"primary"`
}

Email contains various pieces of a users email

type Error added in v0.2.0

type Error struct {
	Message string `json:"message"`
	Name    string `json:"name"`
}

Error defines struct of a houston response Error object

type GraphQLQuery

type GraphQLQuery struct {
	Query string `json:"query"`
}

GraphQLQuery wraps a graphql query string

type InitSubscription added in v0.9.0

type InitSubscription struct {
	Type    string      `json:"type"`
	Payload AuthPayload `json:"payload"`
}

type Request added in v0.7.0

type Request struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`
}

func (*Request) Do added in v0.7.0

func (r *Request) Do() (*Response, error)

Do (request) is a wrapper to more easily pass variables to a client.Do request

func (*Request) DoWithClient added in v0.10.3

func (r *Request) DoWithClient(api *Client) (*Response, error)

Do (request) is a wrapper to more easily pass variables to a client.Do request

type Response added in v0.8.0

type Response struct {
	Data struct {
		AddWorkspaceUser               *Workspace                `json:"workspaceAddUser,omitempty"`
		RemoveWorkspaceUser            *Workspace                `json:"workspaceRemoveUser,omitempty"`
		CreateDeployment               *Deployment               `json:"createDeployment,omitempty"`
		CreateToken                    *AuthUser                 `json:"createToken,omitempty"`
		CreateWorkspaceServiceAccount  *WorkspaceServiceAccount  `json:"createWorkspaceServiceAccount,omitempty"`
		CreateDeploymentServiceAccount *DeploymentServiceAccount `json:"createDeploymentServiceAccount,omitempty"`
		CreateUser                     *AuthUser                 `json:"createUser,omitempty"`
		CreateWorkspace                *Workspace                `json:"createWorkspace,omitempty"`
		DeleteDeployment               *Deployment               `json:"deleteDeployment,omitempty"`
		DeleteWorkspaceServiceAccount  *ServiceAccount           `json:"deleteWorkspaceServiceAccount,omitempty"`
		DeleteDeploymentServiceAccount *ServiceAccount           `json:"deleteDeploymentServiceAccount,omitempty"`
		DeleteWorkspace                *Workspace                `json:"deleteWorkspace,omitempty"`
		GetDeployments                 []Deployment              `json:"workspaceDeployments,omitempty"`
		GetAuthConfig                  *AuthConfig               `json:"authConfig,omitempty"`
		GetAppConfig                   *AppConfig                `json:"appConfig,omitempty"`
		GetServiceAccounts             []ServiceAccount          `json:"serviceAccounts,omitempty"`
		GetUsers                       []User                    `json:"users,omitempty"`
		GetWorkspaces                  []Workspace               `json:"workspaces,omitempty"`
		UpdateDeployment               *Deployment               `json:"updateDeployment,omitempty"`
		UpdateWorkspace                *Workspace                `json:"updateWorkspace,omitempty"`
		DeploymentLog                  []DeploymentLog           `json:"logs,omitempty"`
		WorkspaceUpdateUserRole        string                    `json:"workspaceUpdateUserRole,omitempty"`
		DeploymentConfig               DeploymentConfig          `json:"deploymentConfig,omitempty"`
	} `json:"data"`
	Errors []Error `json:"errors,omitempty"`
}

Response wraps all houston response structs used for json marashalling

type RoleBinding added in v0.9.0

type RoleBinding struct {
	Role string `json:"role"`
	User struct {
		Id       string `json:"id"`
		Username string `json:"username"`
	} `json:"user"`
}

type ServiceAccount added in v0.6.0

type ServiceAccount struct {
	Id         string `json:"id"`
	ApiKey     string `json:"apiKey"`
	Label      string `json:"label"`
	Category   string `json:"category"`
	EntityType string `json:"entityType"`
	EntityId   string `json:"entityUuid"`
	LastUsedAt string `json:"lastUsedAt"`
	CreatedAt  string `json:"createdAt"`
	UpdatedAt  string `json:"updatedAt"`
	Active     bool   `json:"active"`
}

ServiceAccount defines a structure of a ServiceAccountResponse object

type StartSubscription added in v0.9.0

type StartSubscription struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

type Status added in v0.2.0

type Status struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Code    string `json:"code"`
	Id      string `json:"id"`
}

Status defines structure of a houston response StatusResponse object

type Token

type Token struct {
	Value   string       `json:"value"`
	Payload TokenPayload `json:"payload"`
}

Token contains a houston auth token as well as it's payload of components

type TokenPayload added in v0.2.0

type TokenPayload struct {
	Id  string `json:"id"`
	Iat int    `json:"iat"`
	Exp int    `json:"exp"`
}

TokenPayload contains components of a houston auth token

type User added in v0.2.0

type User struct {
	Id       string  `json:"id"`
	Emails   []Email `json:"emails"`
	Username string  `json:"username"`
	Status   string  `json:"status"`
}

User contains all components of an Astronomer user

type WSResponse added in v0.9.0

type WSResponse struct {
	Id      string
	Type    string `json:"type"`
	Payload struct {
		Data struct {
			Log struct {
				Id        string `json:"id"`
				CreatedAt string `json:"createdAt"`
				Log       string `json:"log"`
			} `json:"log"`
		} `json:"data"`
	} `json:"payload"`
}

type Workspace added in v0.2.0

type Workspace struct {
	Id          string `json:"id"`
	Label       string `json:"label"`
	Description string `json:"description"`
	Users       []User `json:"users"`
	// groups
	CreatedAt    string        `json:"createdAt"`
	UpdatedAt    string        `json:"updatedAt"`
	RoleBindings []RoleBinding `json:"roleBindings"`
}

Workspace contains all components of an Astronomer Workspace

type WorkspaceServiceAccount added in v0.10.3

type WorkspaceServiceAccount struct {
	Id            string `json:"id"`
	ApiKey        string `json:"apiKey"`
	Label         string `json:"label"`
	Category      string `json:"category"`
	EntityType    string `json:"entityType"`
	WorkspaceUuid string `json:"workspaceUuid"`
	LastUsedAt    string `json:"lastUsedAt"`
	CreatedAt     string `json:"createdAt"`
	UpdatedAt     string `json:"updatedAt"`
	Active        bool   `json:"active"`
}

WorkspaceServiceAccount defines a structure of a WorkspaceServiceAccountResponse object

Jump to

Keyboard shortcuts

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