houston

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: Apache-2.0 Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig added in v0.2.0

type AuthConfig struct {
	LocalEnabled  bool   `json:"localEnabled"`
	GoogleEnabled bool   `json:"googleEnabled"`
	OauthUrl      string `json:"googleOAuthUrl"`
}

AuthConfig holds data related to oAuth and basic authentication

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) AddWorkspaceUser added in v0.2.0

func (c *Client) AddWorkspaceUser(workspaceId, email string) (*Workspace, error)

AddWorkspaceUser sends request to Houston to add a user to a workspace Returns a Workspace object

func (*Client) CreateBasicToken added in v0.2.0

func (c *Client) CreateBasicToken(email, password string) (*AuthUser, error)

CreateBasicToken sends request to Houston in order to fetch a Basic user Token Returns an AuthUser object

func (*Client) CreateDeployment

func (c *Client) CreateDeployment(label, wsId string) (*Deployment, error)

CreateDeployment sends request to Houston to create a new Airflow deployment cluster Returns a Deployment object

func (*Client) CreateOAuthToken added in v0.2.0

func (c *Client) CreateOAuthToken(authCode string) (*AuthUser, error)

CreateOAuthToken passes an OAuth type and authCode to createOauthTokenRequest in order allow houston to authenticate user Returns a Token structure with the users ID and Token inside.

func (*Client) CreateUser added in v0.2.0

func (c *Client) CreateUser(email string, password string) (*AuthUser, error)

CreateUser sends request to request to Houston in order to create a new platform User Returns an AuthUser object containing an token

func (*Client) CreateWorkspace added in v0.2.0

func (c *Client) CreateWorkspace(label, description string) (*Workspace, error)

CreateWorkspace will send a request to Houston to create a new workspace Returns an object representing created workspace

func (*Client) DeleteDeployment added in v0.2.0

func (c *Client) DeleteDeployment(uuid string) (*Deployment, error)

DeleteDeployment sends a request to Houston in order to delete a specified deployment Returns a Deployment object which represents the Deployment that was deleted

func (*Client) DeleteWorkspace added in v0.2.0

func (c *Client) DeleteWorkspace(uuid string) (*Workspace, error)

DeleteWorkspace will send a request to Houston to create a new workspace Returns an object representing deleted workspace

func (*Client) GetAuthConfig added in v0.2.0

func (c *Client) GetAuthConfig() (*AuthConfig, error)

GetAuthConfig will get authentication configuration from houston Returns the requested AuthConfig object

func (*Client) GetDeployment added in v0.2.0

func (c *Client) GetDeployment(deploymentUuid string) (*Deployment, error)

GetDeployment will request a specific airflow deployments from Houston by uuid Returns a Deployment structure with deployment details

func (*Client) GetDeployments added in v0.2.0

func (c *Client) GetDeployments(ws string) ([]Deployment, error)

GetDeployments will request all airflow deployments from Houston Returns a []Deployment structure with deployment details

func (*Client) GetUserAll added in v0.2.0

func (c *Client) GetUserAll() ([]User, error)

GetUserAll sends a request to Houston in order to fetch a slice of users Returns a slice of all users a user has permission to view

func (*Client) GetWorkspaceAll added in v0.2.0

func (c *Client) GetWorkspaceAll() ([]Workspace, error)

GetWorkspaceAll returns all available workspaces from houston API Returns a slice of all Workspaces a user has access to

func (*Client) QueryHouston

func (c *Client) QueryHouston(query string) (*HoustonResponse, error)

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

func (*Client) RemoveWorkspaceUser added in v0.2.0

func (c *Client) RemoveWorkspaceUser(workspaceId, email string) (*Workspace, error)

RemoveWorkspaceUser sends a request to Houston in order to remove a user from a workspace Returns an object representing the Workspace from which the user was removed

func (*Client) UpdateDeployment added in v0.2.0

func (c *Client) UpdateDeployment(deploymentId, jsonPayload string) (*Deployment, error)

UpdateDeployment sends a request to Houston in order to update the attributes of deployment Returns the updated Deployment object

func (*Client) UpdateWorkspace added in v0.2.0

func (c *Client) UpdateWorkspace(workspaceId, jsonPayload string) (*Workspace, error)

UpdateWorkspace sends a request to Houston in order to update the attributes of the workspace Returns an updated Workspace 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:"uuid"`
	Type           string         `json:"type"`
	Label          string         `json:"label"`
	ReleaseName    string         `json:"releaseName"`
	Version        string         `json:"version"`
	DeploymentInfo DeploymentInfo `json:"deployInfo"`
	Workspace      string         `json:"workspace"`
	CreatedAt      string         `json:"createdAt"`
	UpdatedAt      string         `json:"updatedAt"`
}

Deployment defines structure of a houston response Deployment object

type DeploymentInfo added in v0.2.0

type DeploymentInfo struct {
	Latest string `json:"latest"`
	Next   string `json:"next"`
}

DeploymentInfo contains registry related information for a deployment

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"`
}

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 HoustonResponse

type HoustonResponse struct {
	Data struct {
		AddWorkspaceUser    *Workspace   `json:"workspaceAddUser,omitempty"`
		RemoveWorkspaceUser *Workspace   `json:"workspaceRemoveUser,omitempty"`
		CreateDeployment    *Deployment  `json:"createDeployment,omitempty"`
		CreateToken         *AuthUser    `json:"createToken,omitempty"`
		CreateUser          *AuthUser    `json:"createUser,omitempty"`
		CreateWorkspace     *Workspace   `json:"createWorkspace,omitempty"`
		DeleteDeployment    *Deployment  `json:"deleteDeployment,omitempty"`
		DeleteWorkspace     *Workspace   `json:"deleteWorkspace,omitempty"`
		GetDeployments      []Deployment `json:"deployments,omitempty"`
		GetAuthConfig       *AuthConfig  `json:"authConfig,omitempty"`
		GetUsers            []User       `json:"users,omitempty"`
		GetWorkspace        []Workspace  `json:"workspaces,omitempty"`
		UpdateDeployment    *Deployment  `json:"updateDeployment,omitempty"`
		UpdateWorkspace     *Workspace   `json:"updateWorkspace,omitempty"`
	} `json:"data"`
	Errors []Error `json:"errors,omitempty"`
}

HoustonResponse wraps all houston response structs used for json marashalling

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 {
	Uuid string `json:"uuid"`
	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 {
	Uuid     string  `json:"uuid"`
	Emails   []Email `json:"emails"`
	Username string  `json:"username"`
	Status   string  `json:"status"`
}

User contains all components of an Astronomer user

type Workspace added in v0.2.0

type Workspace struct {
	Uuid        string `json:"uuid"`
	Label       string `json:"label"`
	Description string `json:"description"`
	Active      bool   `json:"active"`
	Users       []User `json:"users"`
	// groups
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
}

Workspace contains all components of an Astronomer Workspace

Jump to

Keyboard shortcuts

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