stacksmith

package
v0.0.0-...-605def9 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Status  string `json:"status"`
	Message string `json:"error"`
}

APIError ...

func (APIError) Empty

func (e APIError) Empty() bool

Empty ...

func (APIError) Error

func (e APIError) Error() string

type APIKeyParam

type APIKeyParam struct {
	APIKey string `url:"api_key"`
}

APIKeyParam ...

type Changelog

type Changelog struct {
	TotalEntries int `json:"total_entries"`
	TotalPAges   int `json:"total_pages"`
	Items        []struct {
		Version         string `json:"version"`
		Revision        int    `json:"revision"`
		Branch          string `json:"branch"`
		Checksum        string `json:"checksum"`
		PublishedAt     string `json:"published_at"`
		ReleaseNotes    string `json:"release_notes"`
		ReleaseNotesURL string `json:"release_notes_url"`
	} `json:"items"`
}

Changelog ...

type Channel

type Channel struct {
	ID           string `json:"id"`
	SlackChannel string `json:"slack_channel"`
}

Channel ...

type Client

type Client struct {
	Stacks    *StacksService
	Hooks     *HooksService
	Discovery *DiscoveryService
	User      *UserService
	// contains filtered or unexported fields
}

Client is a Stacksmith client for making Stacksmith API requests.

func NewClient

func NewClient(apiKey string, httpClient *http.Client) *Client

NewClient return a new Client

type Component

type Component struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Branch   string `json:"branch"`
	Version  string `json:"version"`
	Revision int    `json:"revision"`
	Checksum string `json:"checksum"`
	Outdated bool   `json:"outdated"`
	Category string `json:"category"`
	Latest   struct {
		Version  string `json:"version"`
		Revision int    `json:"revision"`
	} `json:"latest"`
	Vulnerabilities struct {
		Vulnerable bool                `json:"vulnerable"`
		Severity   string              `json:"severity"`
		Items      []VulnerabilityItem `json:"items"`
	} `json:"vulnerabilities"`
}

Component ...

type ComponentItem

type ComponentItem struct {
	ID      string `json:"id"`
	Version string `json:"version"`
}

ComponentItem ...

type Dependencies

type Dependencies struct {
	TotalEntries int      `json:"total_entries"`
	TotalPages   int      `json:"total_pages"`
	Items        []string `json:"items"`
}

Dependencies ...

type DiscoveryService

type DiscoveryService struct {
	// contains filtered or unexported fields
}

DiscoveryService provides methods for accessing Stacksmith Discovery API endpoints.

func (*DiscoveryService) ComponentsList

func (s *DiscoveryService) ComponentsList(query string) (*ListItems, *http.Response, error)

ComponentsList List all available components. https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_components

func (*DiscoveryService) FlavorsList

func (s *DiscoveryService) FlavorsList(pageParams *PaginationParams) (*Flavors, *http.Response, error)

FlavorsList List all available Flavors https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_flavors

func (*DiscoveryService) GetChangelogFrom

func (s *DiscoveryService) GetChangelogFrom(componentName string,
	rangeParam *RangeParams, pageParam *PaginationParams) (*Changelog, *http.Response, error)

GetChangelogFrom Retrieve the changelog for a component https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_components_id_changelog

func (*DiscoveryService) GetComponent

func (s *DiscoveryService) GetComponent(componentName string) (*Item, *http.Response, error)

GetComponent Retrieve the properties from a components https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_components_id

func (*DiscoveryService) GetDependenciesFrom

func (s *DiscoveryService) GetDependenciesFrom(componentName string) (*Dependencies, *http.Response, error)

GetDependenciesFrom Retrieve the component ID of the component dependencies https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_components_id_dependencies

func (*DiscoveryService) GetFlavorsFrom

func (s *DiscoveryService) GetFlavorsFrom(componentName string,
	pageParams *PaginationParams) (*Flavors, *http.Response, error)

GetFlavorsFrom Retrieve the available kinds from a component https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_components_id_flavors

func (*DiscoveryService) OsesList

func (s *DiscoveryService) OsesList(query string) (*ListItems, *http.Response, error)

OsesList List all available OSes. https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_oses

func (*DiscoveryService) RuntimesList

func (s *DiscoveryService) RuntimesList(query string) (*ListItems, *http.Response, error)

RuntimesList List all available components in the runtimes category. https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_runtimes

func (*DiscoveryService) ServicesList

func (s *DiscoveryService) ServicesList(query string) (*ListItems, *http.Response, error)

ServicesList List all available components in the services category. https://stacksmith.bitnami.com/api/v1/#!/Discovery/get_services

type EmailNotifications

type EmailNotifications struct {
	EmailNotificationsEnabled bool `json:"email_notifications_enabled"`
}

EmailNotifications ...

type Flavors

type Flavors struct {
	TotalEntries int `json:"total_entries"`
	TotalPages   int `json:"total_pages"`
	Items        []struct {
		ID           string `json:"id"`
		Name         string `json:"name"`
		Description  string `json:"description"`
		Default      bool   `json:"default"`
		ComponentURL string `json:"component_url"`
	} `json:"items"`
}

Flavors ...

type HookParams

type HookParams struct {
	URL string `json:"url"`
}

HookParams ...

type HooksList

type HooksList struct {
	TotalEntries int `json:"total_entries"`
	TotalPages   int `json:"total_pages"`
	Items        []struct {
		ID  string `json:"id"`
		URL string `json:"url"`
	} `json:"items"`
}

HooksList ...

type HooksService

type HooksService struct {
	// contains filtered or unexported fields
}

HooksService provides methods for accessing Stacksmith Stack Hooks API endpoints.

func (*HooksService) List

func (s *HooksService) List(stackID string, params *PaginationParams) (*HooksList, *http.Response, error)

List List all hooks for this stack. https://stacksmith.bitnami.com/api/v1/#!/Stack_Hooks/get_stacks_stack_id_hooks

func (*HooksService) Register

func (s *HooksService) Register(stackID string, params *HookParams) (*ResponseGeneration, *http.Response, error)

Register Register a URL as a hook that will be triggered when there are updates for your stacks. https://stacksmith.bitnami.com/api/v1/#!/Stack_Hooks/post_stacks_stack_id_hooks

func (*HooksService) Test

func (s *HooksService) Test(stackID string, hookID string) (*TestHook, *http.Response, error)

Test Send a test payload to the URL endpoint. https://stacksmith.bitnami.com/api/v1/#!/Stack_Hooks/post_stacks_stack_id_hooks_id_test

func (*HooksService) Update

func (s *HooksService) Update(stackID string, hookID string, params *HookParams) (*ResponseGeneration, *http.Response, error)

Update Update the URL for a previously registered hook. https://stacksmith.bitnami.com/api/v1/#!/Stack_Hooks/patch_stacks_stack_id_hooks_id

type Item

type Item struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Category string `json:"category"`
	Versions []struct {
		Version     string `json:"version"`
		Revision    int    `json:"revision"`
		Branch      string `json:"branch"`
		Checksum    string `json:"checksum"`
		PublishedAt string `json:"published_at"`
	} `json:"versions"`
	Prebuilt      bool `json:"prebuilt"`
	ReleaseSeries []struct {
		Version string `json:"version"`
		Payload string `json:"payload"`
	} `json:"release_series"`
	DependenciesURL string `json:"dependencies_url"`
}

Item ...

type ListItems

type ListItems struct {
	Items []Item `json:"items"`
}

ListItems ...

type PaginationParams

type PaginationParams struct {
	Page    int `url:"page,omitempty"`
	PerPage int `url:"per_page,omitempty"`
}

PaginationParams ...

type Query

type Query struct {
	Query string `url:"query,omitempty"`
}

Query ...

type RangeParams

type RangeParams struct {
	From string `url:"from,omitempty"`
	To   string `url:"to,omitempty"`
}

RangeParams ...

type ResponseGeneration

type ResponseGeneration struct {
	ID  string `json:"id"`
	URL string `json:"url"`
}

ResponseGeneration ...

type SlackChannels

type SlackChannels struct {
	TotalEntries int       `json:"total_entries"`
	TotalPAges   int       `json:"total_pages"`
	Items        []Channel `json:"items"`
}

SlackChannels ...

type Stack

type Stack struct {
	ID                   string `json:"id"`
	Name                 string `json:"name"`
	Status               string `json:"status"`
	GeneratedAt          string `json:"generated_at"`
	RegeneratedAt        string `json:"regenerated_at"`
	Outdated             bool   `json:"outdated"`
	NotificationsEnabled bool   `json:"notifications_enabled"`
	Requirements         []struct {
		ID      string `json:"id"`
		Version string `json:"version"`
	} `json:"requirements"`
	Vulnerabilities struct {
		URL        string `json:"url"`
		Vulnerable bool   `json:"vulnerable"`
		Severity   string `json:"severity"`
	} `json:"vulnerabilities"`
	Flavor struct {
		ID           string `json:"id"`
		Name         string `json:"name"`
		Description  string `json:"description"`
		Default      bool   `json:"default"`
		ComponentURL string `json:"component_url"`
	} `json:"flavor"`
	Components []Component `json:"components"`
	Os         Component   `json:"os"`
	Output     struct {
		Dockerfile string `json:"dockerfile"`
	} `json:"output"`
	Shared       bool   `json:"shared"`
	ShareableURL string `json:"shareable_url"`
}

Stack ...

type StackDefinition

type StackDefinition struct {
	Name       string          `json:"name"`
	Components []ComponentItem `json:"components"`
	OS         ComponentItem   `json:"os"`
	Flavor     string          `json:"flavor"`
}

StackDefinition ...

type StackParams

type StackParams struct {
	Name                 string `json:"name"`
	NotificationsEnabled bool   `json:"notifications_enabled"`
	Shared               bool   `json:"shared"`
}

StackParams ...

type StacksList

type StacksList struct {
	TotalEntries int `json:"total_entries"`
	TotalPages   int `json:"total_pages"`
	Items        []struct {
		ID                   string `json:"id"`
		Name                 string `json:"name"`
		Status               string `json:"status"`
		GeneratedAt          string `json:"generated_at"`
		RegeneratedAt        string `json:"regenerated_at"`
		Outdated             bool   `json:"outdated"`
		NotificationsEnabled bool   `json:"notifications_enabled"`
		Vulnerabilities      struct {
			URL        string `json:"url"`
			Vulnerable bool   `json:"vulnerable"`
			Severity   string `json:"severity"`
		} `json:"vulnerabilities"`
		Output struct {
			Dockerfile string `json:"dockerfile"`
		} `json:"output"`
		Shared       bool   `json:"shared"`
		ShareableURL string `json:"shareable_url"`
	} `json:"items"`
}

StacksList ...

type StacksService

type StacksService struct {
	// contains filtered or unexported fields
}

StacksService provides methods for accessing Stacksmith Stacks API endpoints.

func (*StacksService) Create

Create Create a stack by specifying the components you need, its kind and its OS. https://stacksmith.bitnami.com/api/v1/#!/Stacks/post_stacks

func (*StacksService) Delete

func (s *StacksService) Delete(stackID string) (*StatusDeletion, *http.Response, error)

Delete Delete a stack. https://stacksmith.bitnami.com/api/v1/#!/Stacks/delete_stacks_id

func (*StacksService) Get

func (s *StacksService) Get(stackID string) (*Stack, *http.Response, error)

Get Retrieve the properties of a stack, to list the versions of the framework, runtime, and OS generated. https://stacksmith.bitnami.com/api/v1/#!/Stacks/get_stacks_id

func (*StacksService) GetVulnerabilities

func (s *StacksService) GetVulnerabilities(stackID string, params *PaginationParams) (*Vulnerability, *http.Response, error)

GetVulnerabilities Retrieve the list of vulnerabilities affecting a stack. https://stacksmith.bitnami.com/api/v1/#!/Stacks/get_stacks_id_vulnerabilities

func (*StacksService) List

List List all stacks attached to your account. https://stacksmith.bitnami.com/api/v1/#!/Stacks/get_stacks

func (*StacksService) Regenerate

func (s *StacksService) Regenerate(stackID string) (*StatusGeneration, *http.Response, error)

Regenerate Create a new stack based on the requirements of another, if there are new versions for it's requirements. https://stacksmith.bitnami.com/api/v1/#!/Stacks/post_stacks_id_regenerate

func (*StacksService) Update

func (s *StacksService) Update(stackID string, params *StackParams) (*StatusGeneration, *http.Response, error)

Update Update the properties of an existing stack. https://stacksmith.bitnami.com/api/v1/#!/Stacks/patch_stacks_id

type StatusDeletion

type StatusDeletion struct {
	ID      string `json:"id"`
	Deleted bool   `json:"deleted"`
}

StatusDeletion ...

type StatusGeneration

type StatusGeneration struct {
	ID       string `json:"id"`
	StackURL string `json:"stack_url"`
}

StatusGeneration ...

type TestHook

type TestHook struct {
	ID     string `json:"id"`
	Result struct {
		Request struct {
			URL  string `json:"url"`
			Body string `json:"body"`
		} `json:"request"`
	} `json:"result"`
	Response struct {
		Code    string `json:"code"`
		Body    string `json:"body"`
		Message string `json:"message"`
	}
}

TestHook ...

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

UserService provides methods for accessing Stacksmith User API endpoints.

func (*UserService) ListSlackChannels

func (s *UserService) ListSlackChannels(params *PaginationParams) (*SlackChannels, *http.Response, error)

ListSlackChannels List all slack channels you have added integrations to. https://stacksmith.bitnami.com/api/v1/#!/User/get_user_slack_channels

func (*UserService) RemoveSlackChannel

func (s *UserService) RemoveSlackChannel(slackChannelID string) (*StatusDeletion, *http.Response, error)

RemoveSlackChannel Remove a Slack channel integration. https://stacksmith.bitnami.com/api/v1/#!/User/delete_user_slack_channels_id

func (*UserService) TestSlackIntegration

func (s *UserService) TestSlackIntegration(slackChannelID string) (*Channel, *http.Response, error)

TestSlackIntegration Send a test notification to a Slack channel. https://stacksmith.bitnami.com/api/v1/#!/User/post_user_slack_channels_id_test

func (*UserService) UpdateNotifications

func (s *UserService) UpdateNotifications(params *EmailNotifications) (*EmailNotifications, *http.Response, error)

UpdateNotifications Update your email notification settings https://stacksmith.bitnami.com/api/v1/#!/User/patch_user

type Vulnerability

type Vulnerability struct {
	TotalEntries int                 `json:"total_entries"`
	TotalPages   int                 `json:"total_pages"`
	Items        []VulnerabilityItem `json:"items"`
}

Vulnerability ...

type VulnerabilityItem

type VulnerabilityItem struct {
	Name     string `json:"name"`
	Severity string `json:"severity"`
	Ranges   []struct {
		Component string `json:"component"`
		From      string `json:"from"`
		To        string `json:"to"`
	} `json:"ranges"`
}

VulnerabilityItem ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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