Skip to content

Commit

Permalink
Rename fetch to get to match houston std
Browse files Browse the repository at this point in the history
  • Loading branch information
andscoop committed Jul 5, 2018
1 parent 3178a5a commit bba202e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions airflow/docker.go
Expand Up @@ -129,7 +129,7 @@ func Start(airflowHome string) error {
return errors.Wrap(err, messages.COMPOSE_CREATE_ERROR)
}

// Fetch project containers
// Get project containers
psInfo, err := project.Ps(context.Background())
if err != nil {
return errors.Wrap(err, messages.COMPOSE_STATUS_CHECK_ERROR)
Expand Down Expand Up @@ -244,7 +244,7 @@ func PS(airflowHome string) error {
// Deploy pushes a new docker image
func Deploy(path, name, wsId string) error {
if name == "" {
deployments, err := api.FetchDeployments(wsId)
deployments, err := api.GetDeployments(wsId)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion deployment/deployment.go
Expand Up @@ -42,7 +42,7 @@ func Delete(uuid string) error {

// List all airflow deployments
func List(ws string) error {
deployments, err := api.FetchDeployments(ws)
deployments, err := api.GetDeployments(ws)
if err != nil {
return err
}
Expand Down
22 changes: 11 additions & 11 deletions houston/houston.go
Expand Up @@ -111,7 +111,7 @@ var (
}
}`

fetchDeploymentsRequest = `
getDeploymentsRequest = `
query GetDeployments {
deployments(teamUuid: "%s") {
uuid
Expand All @@ -124,7 +124,7 @@ var (
}
}`

fetchDeploymentRequest = `
getDeploymentRequest = `
query GetDeployment {
deployments(
deploymentUuid: "%s"
Expand Down Expand Up @@ -315,27 +315,27 @@ func (c *Client) DeleteWorkspace(uuid string) (*Workspace, error) {
return response.Data.DeleteWorkspace, nil
}

// FetchDeployments will request all airflow deployments from Houston
// GetDeployments will request all airflow deployments from Houston
// Returns a []Deployment structure with deployment details
func (c *Client) FetchDeployments(ws string) ([]Deployment, error) {
request := fmt.Sprintf(fetchDeploymentsRequest, ws)
func (c *Client) GetDeployments(ws string) ([]Deployment, error) {
request := fmt.Sprintf(getDeploymentsRequest, ws)

response, err := c.QueryHouston(request)
if err != nil {
return nil, errors.Wrap(err, "FetchDeployments Failed")
return nil, errors.Wrap(err, "GetDeployments Failed")
}

return response.Data.GetDeployments, nil
}

// FetchDeployment will request a specific airflow deployments from Houston by uuid
// GetDeployment will request a specific airflow deployments from Houston by uuid
// Returns a Deployment structure with deployment details
func (c *Client) FetchDeployment(deploymentUuid string) (*Deployment, error) {
request := fmt.Sprintf(fetchDeploymentRequest, deploymentUuid)
func (c *Client) GetDeployment(deploymentUuid string) (*Deployment, error) {
request := fmt.Sprintf(getDeploymentRequest, deploymentUuid)

response, err := c.QueryHouston(request)
if err != nil {
return nil, errors.Wrap(err, "FetchDeployment Failed")
return nil, errors.Wrap(err, "GetDeployment Failed")
}

if len(response.Data.GetDeployments) == 0 {
Expand All @@ -344,7 +344,7 @@ func (c *Client) FetchDeployment(deploymentUuid string) (*Deployment, error) {
return &response.Data.GetDeployments[0], nil
}

// GetAuthConfig will fetch authentication configuration from houston
// GetAuthConfig will get authentication configuration from houston
func (c *Client) GetAuthConfig() (*AuthConfig, error) {
request := getAuthConfigRequest

Expand Down

0 comments on commit bba202e

Please sign in to comment.