Documentation
¶
Index ¶
- func FromAPIIncludedSolutionDependencies(sp chef.SolutionDep) []*response.SolutionDependencies
- func GRPC(addr string, s *service.Service) error
- func GetExpandRunlistFromRole(runlist []string, result *RoleListResult) ([]*response.RunList, error)
- func GetOrgAdminKeyFrom(secret *secrets.Secret) string
- func InputValidationInterceptor() grpc.UnaryServerInterceptor
- func NewGRPCServer(s *service.Service) *grpc.Server
- func ParseAPIError(err error) error
- func RemoveElement(a []string, str string) []string
- func SafeBooleanFromMap(values map[string]interface{}, key string) bool
- func SafeSliceFromMap(values map[string]interface{}, key string) []string
- func SafeStringFromMap(values map[string]interface{}, key string) string
- func SafeStringFromMapFloat(values map[string]interface{}, key string) string
- func StructToJSON(data *structpb.Struct) (interface{}, error)
- func SubtractSlice(a []string, b []string) []string
- func ToResponseExpandedRunList(client *ChefClient, runlist []string, cookbooks chef.EnvironmentCookbookResult, ...) ([]*response.RunList, error)
- func Unique(a []string) []string
- type AccessKeyReq
- type ChefClient
- type ChefConfig
- type InfraServerStatusChecker
- type RoleListResult
- type RunListCache
- type Server
- func (s *Server) CreateClient(ctx context.Context, req *request.CreateClient) (*response.CreateClient, error)
- func (s *Server) CreateDataBag(ctx context.Context, req *request.CreateDataBag) (*response.CreateDataBag, error)
- func (s *Server) CreateDataBagItem(ctx context.Context, req *request.CreateDataBagItem) (*response.CreateDataBagItem, error)
- func (s *Server) CreateEnvironment(ctx context.Context, req *request.CreateEnvironment) (*response.Environment, error)
- func (s *Server) CreateNode(ctx context.Context, req *request.NodeDetails) (*response.Node, error)
- func (s *Server) CreateOrg(ctx context.Context, req *request.CreateOrg) (*response.CreateOrg, error)
- func (s *Server) CreateRole(ctx context.Context, req *request.CreateRole) (*response.Role, error)
- func (s *Server) CreateServer(ctx context.Context, req *request.CreateServer) (*response.CreateServer, error)
- func (s *Server) DeleteClient(ctx context.Context, req *request.Client) (*response.Client, error)
- func (s *Server) DeleteDataBag(ctx context.Context, req *request.DataBag) (*response.DataBag, error)
- func (s *Server) DeleteDataBagItem(ctx context.Context, req *request.DataBagItem) (*response.DataBagItem, error)
- func (s *Server) DeleteEnvironment(ctx context.Context, req *request.Environment) (*response.Environment, error)
- func (s *Server) DeleteNode(ctx context.Context, req *request.Node) (*response.DeleteNode, error)
- func (s *Server) DeleteOrg(ctx context.Context, req *request.DeleteOrg) (*response.DeleteOrg, error)
- func (s *Server) DeletePolicyfile(ctx context.Context, req *request.DeletePolicyfile) (*response.DeletePolicyfile, error)
- func (s *Server) DeleteRole(ctx context.Context, req *request.Role) (*response.Role, error)
- func (s *Server) DeleteServer(ctx context.Context, req *request.DeleteServer) (*response.DeleteServer, error)
- func (s *Server) GetClient(ctx context.Context, req *request.Client) (*response.Client, error)
- func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*response.Clients, error)
- func (s *Server) GetCookbook(ctx context.Context, req *request.Cookbook) (*response.Cookbook, error)
- func (s *Server) GetCookbookFileContent(ctx context.Context, req *request.CookbookFileContent) (*response.CookbookFileContent, error)
- func (s *Server) GetCookbookVersions(ctx context.Context, req *request.CookbookVersions) (*response.CookbookVersions, error)
- func (s *Server) GetCookbooks(ctx context.Context, req *request.Cookbooks) (*response.Cookbooks, error)
- func (s *Server) GetDataBagItem(ctx context.Context, req *request.DataBagItem) (*response.DataBagItem, error)
- func (s *Server) GetDataBagItems(ctx context.Context, req *request.DataBagItems) (*response.DataBagItems, error)
- func (s *Server) GetDataBags(ctx context.Context, req *request.DataBags) (*response.DataBags, error)
- func (s *Server) GetEnvironment(ctx context.Context, req *request.Environment) (*response.Environment, error)
- func (s *Server) GetEnvironmentRecipes(ctx context.Context, req *request.Environment) (*response.EnvironmentRecipesList, error)
- func (s *Server) GetEnvironments(ctx context.Context, req *request.Environments) (*response.Environments, error)
- func (s *Server) GetNode(ctx context.Context, req *request.Node) (*response.Node, error)
- func (s *Server) GetNodeExpandedRunList(ctx context.Context, req *request.NodeExpandedRunList) (*response.NodeExpandedRunList, error)
- func (s *Server) GetNodes(ctx context.Context, req *request.Nodes) (*response.Nodes, error)
- func (s *Server) GetOrg(ctx context.Context, req *request.GetOrg) (*response.GetOrg, error)
- func (s *Server) GetOrgUsersList(ctx context.Context, req *request.OrgUsers) (*response.OrgUsers, error)
- func (s *Server) GetOrgs(ctx context.Context, req *request.GetOrgs) (*response.GetOrgs, error)
- func (s *Server) GetPolicyfile(ctx context.Context, req *request.Policyfile) (*response.Policyfile, error)
- func (s *Server) GetPolicyfileRevisions(ctx context.Context, req *request.PolicyfileRevisions) (*response.PolicyfileRevisions, error)
- func (s *Server) GetPolicyfiles(ctx context.Context, req *request.Policyfiles) (*response.Policyfiles, error)
- func (s *Server) GetPolicygroup(ctx context.Context, req *request.Policygroup) (*response.Policygroup, error)
- func (s *Server) GetRole(ctx context.Context, req *request.Role) (*response.Role, error)
- func (s *Server) GetRoleEnvironments(ctx context.Context, req *request.Role) (*response.RoleEnvironments, error)
- func (s *Server) GetRoleExpandedRunList(ctx context.Context, req *request.ExpandedRunList) (*response.ExpandedRunList, error)
- func (s *Server) GetRoles(ctx context.Context, req *request.Roles) (*response.Roles, error)
- func (s *Server) GetServer(ctx context.Context, req *request.GetServer) (*response.GetServer, error)
- func (s *Server) GetServerStatus(ctx context.Context, req *request.GetServerStatus) (*response.GetServerStatus, error)
- func (s *Server) GetServerUsersList(ctx context.Context, req *request.ServerUsers) (*response.ServerUsers, error)
- func (s *Server) GetServers(ctx context.Context, req *request.GetServers) (*response.GetServers, error)
- func (s *Server) ResetClientKey(ctx context.Context, req *request.ClientKey) (*response.ResetClient, error)
- func (s *Server) ResetOrgAdminKey(ctx context.Context, req *request.ResetOrgAdminKey) (*response.ResetOrgAdminKey, error)
- func (s *Server) SetAuthenticator(statusChecker StatusChecker)
- func (s *Server) UpdateDataBagItem(ctx context.Context, req *request.UpdateDataBagItem) (*response.UpdateDataBagItem, error)
- func (s *Server) UpdateEnvironment(ctx context.Context, req *request.UpdateEnvironment) (*response.Environment, error)
- func (s *Server) UpdateNode(ctx context.Context, req *request.NodeDetails) (*response.Node, error)
- func (s *Server) UpdateNodeAttributes(ctx context.Context, req *request.UpdateNodeAttributes) (*response.UpdateNodeAttributes, error)
- func (s *Server) UpdateNodeEnvironment(ctx context.Context, req *request.UpdateNodeEnvironment) (*response.UpdateNodeEnvironment, error)
- func (s *Server) UpdateNodeTags(ctx context.Context, req *request.UpdateNodeTags) (*response.UpdateNodeTags, error)
- func (s *Server) UpdateOrg(ctx context.Context, req *request.UpdateOrg) (*response.UpdateOrg, error)
- func (s *Server) UpdateRole(ctx context.Context, req *request.UpdateRole) (*response.Role, error)
- func (s *Server) UpdateServer(ctx context.Context, req *request.UpdateServer) (*response.UpdateServer, error)
- type StatusChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromAPIIncludedSolutionDependencies ¶
func FromAPIIncludedSolutionDependencies(sp chef.SolutionDep) []*response.SolutionDependencies
func GetExpandRunlistFromRole ¶
func GetExpandRunlistFromRole(runlist []string, result *RoleListResult) ([]*response.RunList, error)
GetExpandRunlistFromRole expands the run-list based on role's run-list
func GetOrgAdminKeyFrom ¶
GetOrgAdminKeyFrom returns AdminKey
func InputValidationInterceptor ¶
func InputValidationInterceptor() grpc.UnaryServerInterceptor
InputValidationInterceptor is a middleware for running the protobuf validation.
func NewGRPCServer ¶
NewGRPCServer creates a grpc server that serves all infra-proxy-service GRPC APIs
func ParseAPIError ¶
ParseAPIError parses common Chef Infra Server API errors into a user-readable format.
func RemoveElement ¶
RemoveElement removes the element from slice.
func SafeBooleanFromMap ¶
SafeStringFromMap returns the value referenced by `key` in `values`. as a boolean. If not found, it returns a boolean false.
func SafeSliceFromMap ¶
SafeSliceFromMap returns the value referenced by `key` in `values`. as a slice. If not found, it returns an empty slice.
func SafeStringFromMap ¶
SafeStringFromMap returns the value referenced by `key` in `values`. as a string. If not found, it returns an empty string.
func SafeStringFromMapFloat ¶
SafeStringFromMapFloat returns the value referenced by `key` in `values`. as a string (after first formatting as a base 64 float). If not found, it returns an empty string.
func StructToJSON ¶
StructToJSON convert the structpb to JSON interface object.
func SubtractSlice ¶
SubtractSlice returns the slice a with all elements of b removed.
func ToResponseExpandedRunList ¶
func ToResponseExpandedRunList(client *ChefClient, runlist []string, cookbooks chef.EnvironmentCookbookResult, runlistCache RunListCache) ([]*response.RunList, error)
Types ¶
type AccessKeyReq ¶
type AccessKeyReq struct { Name string `json:"name,omitempty"` PublicKey string `json:"public_key,omitempty"` ExpirationDate string `json:"expiration_date,omitempty"` CreateKey bool `json:"create_key,omitempty"` }
AccessKeyReq struct to add key.
type ChefClient ¶
type ChefClient struct {
// contains filtered or unexported fields
}
ChefClient type definition for the chef client
func NewChefClient ¶
func NewChefClient(config *ChefConfig) (*ChefClient, error)
NewChefClient is an infra-proxy server
func (*ChefClient) SearchObjectsWithDefaults ¶
func (c *ChefClient) SearchObjectsWithDefaults(searchIndex string, searchQuery *request.SearchQuery, params map[string]interface{}) (*chef.SearchResult, error)
SearchObjectsWithDefaults constructs the search query with defaults params values Default per_page is set 1000 Default search term q is "*:*" Default page is set to 0
func (*ChefClient) SearchRoles ¶
func (c *ChefClient) SearchRoles(searchQuery *request.SearchQuery) (RoleListResult, error)
SearchRoles gets roles list from Chef Infra Server search API.
type ChefConfig ¶
ChefConfig is an infra-proxy server
type InfraServerStatusChecker ¶
type InfraServerStatusChecker struct { }
InfraServerStatusChecker implements StatusChecker
func (*InfraServerStatusChecker) GetInfraServerStatus ¶
func (s *InfraServerStatusChecker) GetInfraServerStatus(serverHost string) (*http.Response, error)
GetInfraServerStatus gets the status of the Chef Infra Server from https://<server>/_status route
type RoleListResult ¶
type RoleListResult struct { Total int `json:"total"` Start int `json:"start"` Rows []*chef.Role `json:"rows"` }
RoleListResult role list result from Search API
type RunListCache ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an infra-proxy server
func (*Server) CreateClient ¶
func (s *Server) CreateClient(ctx context.Context, req *request.CreateClient) (*response.CreateClient, error)
CreateClient creates the client
func (*Server) CreateDataBag ¶
func (s *Server) CreateDataBag(ctx context.Context, req *request.CreateDataBag) (*response.CreateDataBag, error)
CreateDataBag creates a data bag
func (*Server) CreateDataBagItem ¶
func (s *Server) CreateDataBagItem(ctx context.Context, req *request.CreateDataBagItem) (*response.CreateDataBagItem, error)
CreateDataBagItem creates a data bag item
func (*Server) CreateEnvironment ¶
func (s *Server) CreateEnvironment(ctx context.Context, req *request.CreateEnvironment) (*response.Environment, error)
CreateEnvironment creates the environment
func (*Server) CreateNode ¶
CreateNode creates the node
func (*Server) CreateOrg ¶
func (s *Server) CreateOrg(ctx context.Context, req *request.CreateOrg) (*response.CreateOrg, error)
CreateOrg creates a new org
func (*Server) CreateRole ¶
CreateRole creates the role
func (*Server) CreateServer ¶
func (s *Server) CreateServer(ctx context.Context, req *request.CreateServer) (*response.CreateServer, error)
CreateServer creates a new server
func (*Server) DeleteClient ¶
DeleteClient deletes the client
func (*Server) DeleteDataBag ¶
func (s *Server) DeleteDataBag(ctx context.Context, req *request.DataBag) (*response.DataBag, error)
DeleteDataBag deletes the data bag
func (*Server) DeleteDataBagItem ¶
func (s *Server) DeleteDataBagItem(ctx context.Context, req *request.DataBagItem) (*response.DataBagItem, error)
DeleteDataBagItem deletes the data bag item
func (*Server) DeleteEnvironment ¶
func (s *Server) DeleteEnvironment(ctx context.Context, req *request.Environment) (*response.Environment, error)
DeleteEnvironment deletes the environment
func (*Server) DeleteNode ¶
DeleteNode deletes the node by name
func (*Server) DeleteOrg ¶
func (s *Server) DeleteOrg(ctx context.Context, req *request.DeleteOrg) (*response.DeleteOrg, error)
DeleteOrg deletes an org from the db
func (*Server) DeletePolicyfile ¶
func (s *Server) DeletePolicyfile(ctx context.Context, req *request.DeletePolicyfile) (*response.DeletePolicyfile, error)
DeletePolicyfile deletes the policyfile
func (*Server) DeleteRole ¶
DeleteRole deletes the role
func (*Server) DeleteServer ¶
func (s *Server) DeleteServer(ctx context.Context, req *request.DeleteServer) (*response.DeleteServer, error)
DeleteServer deletes a server from the db
func (*Server) GetClients ¶
GetClients gets clients list
func (*Server) GetCookbook ¶
func (s *Server) GetCookbook(ctx context.Context, req *request.Cookbook) (*response.Cookbook, error)
GetCookbook get cookbook detail
func (*Server) GetCookbookFileContent ¶
func (s *Server) GetCookbookFileContent(ctx context.Context, req *request.CookbookFileContent) (*response.CookbookFileContent, error)
GetCookbookFileContent get the data file content of the cookbook
func (*Server) GetCookbookVersions ¶
func (s *Server) GetCookbookVersions(ctx context.Context, req *request.CookbookVersions) (*response.CookbookVersions, error)
GetCookbookVersions get cookbook with all available versions
func (*Server) GetCookbooks ¶
func (s *Server) GetCookbooks(ctx context.Context, req *request.Cookbooks) (*response.Cookbooks, error)
GetCookbooks get cookbooks list
func (*Server) GetDataBagItem ¶
func (s *Server) GetDataBagItem(ctx context.Context, req *request.DataBagItem) (*response.DataBagItem, error)
GetDataBagItem gets data bag item
func (*Server) GetDataBagItems ¶
func (s *Server) GetDataBagItems(ctx context.Context, req *request.DataBagItems) (*response.DataBagItems, error)
GetDataBagItems gets data bag items list
func (*Server) GetDataBags ¶
func (s *Server) GetDataBags(ctx context.Context, req *request.DataBags) (*response.DataBags, error)
GetDataBags gets data bags list
func (*Server) GetEnvironment ¶
func (s *Server) GetEnvironment(ctx context.Context, req *request.Environment) (*response.Environment, error)
GetEnvironment gets the environment details
func (*Server) GetEnvironmentRecipes ¶
func (s *Server) GetEnvironmentRecipes(ctx context.Context, req *request.Environment) (*response.EnvironmentRecipesList, error)
GetEnvironmentRecipes get environment based recipes list
func (*Server) GetEnvironments ¶
func (s *Server) GetEnvironments(ctx context.Context, req *request.Environments) (*response.Environments, error)
GetEnvironments gets environments list
func (*Server) GetNodeExpandedRunList ¶
func (s *Server) GetNodeExpandedRunList(ctx context.Context, req *request.NodeExpandedRunList) (*response.NodeExpandedRunList, error)
GetNodeExpandedRunList fetches the expanded runlist of a node
func (*Server) GetOrgUsersList ¶
func (s *Server) GetOrgUsersList(ctx context.Context, req *request.OrgUsers) (*response.OrgUsers, error)
GetUsersList Get a list of all users in an organization
func (*Server) GetPolicyfile ¶
func (s *Server) GetPolicyfile(ctx context.Context, req *request.Policyfile) (*response.Policyfile, error)
GetPolicyfile gets a policy file
func (*Server) GetPolicyfileRevisions ¶
func (s *Server) GetPolicyfileRevisions(ctx context.Context, req *request.PolicyfileRevisions) (*response.PolicyfileRevisions, error)
GetPolicyfileRevisions gets a policy file revisions
func (*Server) GetPolicyfiles ¶
func (s *Server) GetPolicyfiles(ctx context.Context, req *request.Policyfiles) (*response.Policyfiles, error)
GetPolicyfiles gets a list of all policy files
func (*Server) GetPolicygroup ¶
func (s *Server) GetPolicygroup(ctx context.Context, req *request.Policygroup) (*response.Policygroup, error)
GetPolicygroup gets a policy group
func (*Server) GetRoleEnvironments ¶
func (s *Server) GetRoleEnvironments(ctx context.Context, req *request.Role) (*response.RoleEnvironments, error)
GetRoleEnvironments fetches the role environments.
func (*Server) GetRoleExpandedRunList ¶
func (s *Server) GetRoleExpandedRunList(ctx context.Context, req *request.ExpandedRunList) (*response.ExpandedRunList, error)
GetRoleExpandedRunList fetches the role run-list.
func (*Server) GetServer ¶
func (s *Server) GetServer(ctx context.Context, req *request.GetServer) (*response.GetServer, error)
GetServer takes an ID and returns a server object
func (*Server) GetServerStatus ¶
func (s *Server) GetServerStatus(ctx context.Context, req *request.GetServerStatus) (*response.GetServerStatus, error)
GetServerStatus get the status of server
func (*Server) GetServerUsersList ¶
func (s *Server) GetServerUsersList(ctx context.Context, req *request.ServerUsers) (*response.ServerUsers, error)
GetServerUsersList: Get a list of all users in server
func (*Server) GetServers ¶
func (s *Server) GetServers(ctx context.Context, req *request.GetServers) (*response.GetServers, error)
GetServers returns a list of servers from the db
func (*Server) ResetClientKey ¶
func (s *Server) ResetClientKey(ctx context.Context, req *request.ClientKey) (*response.ResetClient, error)
ResetClientKey resets the client key Deletes the associated key pair and generates new key pair again, and then attaches it to the client.
func (*Server) ResetOrgAdminKey ¶
func (s *Server) ResetOrgAdminKey(ctx context.Context, req *request.ResetOrgAdminKey) (*response.ResetOrgAdminKey, error)
ResetOrgAdminKey updates the org admin key via PUT
func (*Server) SetAuthenticator ¶
func (s *Server) SetAuthenticator(statusChecker StatusChecker)
func (*Server) UpdateDataBagItem ¶
func (s *Server) UpdateDataBagItem(ctx context.Context, req *request.UpdateDataBagItem) (*response.UpdateDataBagItem, error)
UpdateDataBagItem updates a data bag item
func (*Server) UpdateEnvironment ¶
func (s *Server) UpdateEnvironment(ctx context.Context, req *request.UpdateEnvironment) (*response.Environment, error)
UpdateEnvironment updates the environment attributes
func (*Server) UpdateNode ¶
UpdateNode updates the node
func (*Server) UpdateNodeAttributes ¶
func (s *Server) UpdateNodeAttributes(ctx context.Context, req *request.UpdateNodeAttributes) (*response.UpdateNodeAttributes, error)
UpdateNodeAttributes updates the node attributes
func (*Server) UpdateNodeEnvironment ¶
func (s *Server) UpdateNodeEnvironment(ctx context.Context, req *request.UpdateNodeEnvironment) (*response.UpdateNodeEnvironment, error)
UpdateNodeEnvironment updates the node environment
func (*Server) UpdateNodeTags ¶
func (s *Server) UpdateNodeTags(ctx context.Context, req *request.UpdateNodeTags) (*response.UpdateNodeTags, error)
UpdateNodeTags updates the tags
func (*Server) UpdateOrg ¶
func (s *Server) UpdateOrg(ctx context.Context, req *request.UpdateOrg) (*response.UpdateOrg, error)
UpdateOrg updates an org in the db via PUT
func (*Server) UpdateRole ¶
UpdateRole updates the role
func (*Server) UpdateServer ¶
func (s *Server) UpdateServer(ctx context.Context, req *request.UpdateServer) (*response.UpdateServer, error)
UpdateServer updates a server in the db via post