client

package
v0.0.0-...-c0bf5e4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREDENTIAL_TEMPORARY = "temporary"
	CREDENTIAL_PERSISTED = "persisted"
)
View Source
const (
	SERVICE_STARTED       = "STARTED"
	SERVICE_STOPPED       = "INSTALLED"
	SERVICE_INSTALLED     = "INSTALLED"
	SERVICE_UNKNOWN       = "UNKNOWN"
	SERVICE_INIT          = "INIT"
	MAINTENANCE_STATE_ON  = "ON"
	MAINTENANCE_STATE_OFF = "OFF"
)
View Source
const (
	REQUEST_FAILED    = "FAILED"
	REQUEST_ACCEPTED  = "ACCEPTED"
	REQUEST_COMPLETED = "COMPLETED"
	REQUEST_ABORDED   = "ABORDED"
)
View Source
const (
	COMPONENT_CLIENT = "CLIENT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	AlertInfo *AlertInfo `json:"Alert"`
}

func (*Alert) String

func (a *Alert) String() string

String permit to return Alert object as Json string

type AlertInfo

type AlertInfo struct {
	ClusterName      string `json:"cluster_name,omitempty"`
	ServiceName      string `json:"service_name,omitempty"`
	ComponentName    string `json:"component_name,omitempty"`
	Hostname         string `json:"host_name,omitempty"`
	Label            string `json:"label,omitempty"`
	MaintenanceState string `json:"maintenance_state,omitempty"`
	State            string `json:"state,omitempty"`
	Text             string `json:"text,omitempty"`
	Scope            string `json:"scope,omitempty"`
}

type Alerts

type Alerts struct {
	Items []Alert `json:"items,omitempty"`
}

type AmbariClient

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

Ambari client object

func New

func New(baseUrl string, login string, password string) *AmbariClient

New permit to create new Ambari client It return AmbariClient

func (*AmbariClient) Alerts

func (c *AmbariClient) Alerts(clusterName string) ([]Alert, error)

func (*AmbariClient) AlertsInCluster

func (c *AmbariClient) AlertsInCluster(clusterName string) ([]Alert, error)

func (*AmbariClient) AlertsInHost

func (c *AmbariClient) AlertsInHost(clusterName string, hostname string) ([]Alert, error)

func (*AmbariClient) AlertsInService

func (c *AmbariClient) AlertsInService(clusterName string, serviceName string) ([]Alert, error)

func (*AmbariClient) Blueprint

func (c *AmbariClient) Blueprint(name string) (*Blueprint, error)

Blueprint permit to get blueprint item from is name It return blueprint object if exist, else it return nil It return error if something wrong when call the API

func (*AmbariClient) Client

func (c *AmbariClient) Client() *resty.Client

Client permit to return resty.Client Object

func (*AmbariClient) Cluster

func (c *AmbariClient) Cluster(clusterName string) (*Cluster, error)

Cluster permit to return cluster object from is name It return cluster object if found It return nil if cluster is not found It return error if something wrong when it call the API

func (*AmbariClient) Component

func (c *AmbariClient) Component(clusterName string, serviceName string, componentName string) (*Component, error)

Component permit to get Component item It return Component if found It return nil if service Component not found It return error if something wrong when API call

func (*AmbariClient) CreateBlueprint

func (c *AmbariClient) CreateBlueprint(name string, jsonBlueprint string) (*Blueprint, error)

CreateBlueprint permit to create new blueprint item It return blueprint object if all work fine. It return error if something wrong when call the API

func (*AmbariClient) CreateCluster

func (c *AmbariClient) CreateCluster(cluster *Cluster) (*Cluster, error)

Create cluster eprmit to create new HDP cluster on Ambari It return the cluster object if all work fine It return error if something wrong when it call the API

func (*AmbariClient) CreateClusterFromTemplate

func (c *AmbariClient) CreateClusterFromTemplate(name string, jsonClusterTemplate string) (*Cluster, error)

CreateClusterFromTemplate permit to create new cluster from template file. It use the blueprint object to create automatically a cluster with topologie. It return the cluster object if all work fine It return error if something wrong when it call the API

func (*AmbariClient) CreateComponent

func (c *AmbariClient) CreateComponent(component *Component) (*Component, error)

CreateComponent permit to create new component It return Component if all right fine It return error if something wrong when API call

func (*AmbariClient) CreateConfigurationOnCluster

func (c *AmbariClient) CreateConfigurationOnCluster(clusterName string, configuration *Configuration) (*Cluster, error)

CreateConfigurationOnCluster permit to add new service confoguration on cluster It return cluster object if all right fine It return error if something wrong

func (*AmbariClient) CreateCredential

func (c *AmbariClient) CreateCredential(credential *Credential) (*Credential, error)

CreateCredential permit to create new credential on cluster It return the credential if all work fine It return error if something wrong when it call the API

func (*AmbariClient) CreateHost

func (c *AmbariClient) CreateHost(host *Host) (*Host, error)

CreateHost permit to create host (attach existing Ambari host on existing cluster) I can't permit to set the rack info, you need to update to do that. It return host if all work fine It return error if something wrong when it call the API

func (*AmbariClient) CreateHostComponent

func (c *AmbariClient) CreateHostComponent(hostComponent *HostComponent) (*HostComponent, error)

CreateHostComponent permit to enable component in service to deploy it on host in second time It return HostComponent after the creation. The component is in INIT state. If component already exist, it do nothink. It return error if component not exist on service or if there are some error in API call.

func (*AmbariClient) CreatePrivilege

func (c *AmbariClient) CreatePrivilege(clusterName string, privilege *Privilege) (*Privilege, error)

CreatePrivilege permit to create new privilege on cluster It return the privilege if all work fine It return error if something wrong when it call the API

func (*AmbariClient) CreateRepository

func (c *AmbariClient) CreateRepository(repository *Repository) (*Repository, error)

CreateRepository permit to create new repository It return repository if all work fine It return error if something wrong when it call the API

func (*AmbariClient) CreateService

func (c *AmbariClient) CreateService(service *Service) (*Service, error)

CreateService permit to create new service The service is created in INIT state It return the service if all work fine It return error if something wrong when it call the API

func (*AmbariClient) Credential

func (c *AmbariClient) Credential(clusterName string, alias string) (*Credential, error)

Credential return existing credential on cluster It return the credential if is found It return nil if not found It return error if something wrong when it call the API

func (*AmbariClient) Credentials

func (c *AmbariClient) Credentials(clusterName string) ([]Credential, error)

Credentials return all credential on cluster It return the list of credential.

If not credential, it return empty list.

It return error if something wrong when it call the API

func (*AmbariClient) DeleteAllComponentsInHost

func (c *AmbariClient) DeleteAllComponentsInHost(clusterName string, hostname string, disableMaintenanceMode bool) error

DeleteAllComponentsInHost stop and delete all components in host in arbitrary order if disableMaintenanceMode is set to true, it will remove maintenance state in host before to delete all ressources

func (*AmbariClient) DeleteBlueprint

func (c *AmbariClient) DeleteBlueprint(name string) error

DeleteBlueprint permit to delete blueprint item It return error if blueprint item not exist or if something wrong when call the API

func (*AmbariClient) DeleteCluster

func (c *AmbariClient) DeleteCluster(clusterName string) error

DeleteCluster permit to delete existing cluster It need to delete all services and delete all hosts before to delete the cluster It return error if cluster not exist of something wrong when it call the API

func (*AmbariClient) DeleteComponent

func (c *AmbariClient) DeleteComponent(clusterName string, serviceName string, componentName string) error

Delete component permit to delete existing component before to delete component, we need to remove them from host It return error if component not exist It return error if something wrong when API call

func (*AmbariClient) DeleteCredential

func (c *AmbariClient) DeleteCredential(clusterName string, alias string) error

DeleteCredential permit to delete existing credential on cluster It return error if something wrong when it call the API

func (*AmbariClient) DeleteHost

func (c *AmbariClient) DeleteHost(clusterName string, hostname string) error

Delete host permit to delete host on clusterS It need to delete all component hosted on host before to delete the host

func (*AmbariClient) DeleteHostComponent

func (c *AmbariClient) DeleteHostComponent(clusterName string, hostname string, componentName string) error

DeleteHostComponent permit to delete component on host It will stop the component before to delete it It will return error if component is not found or if there are some error during API call

func (*AmbariClient) DeletePrivilege

func (c *AmbariClient) DeletePrivilege(clusterName string, id int64) error

DeletePrivilege permit to delete existing privielege on cluster It return error if something wrong when it call the API

func (*AmbariClient) DeleteRepository

func (c *AmbariClient) DeleteRepository(stackName string, stackVersion string, repositoryId int) error

DeleteRepository permit to remove the repository You can't delete the current repository use by the cluster It return error if something wrong when it call the API

func (*AmbariClient) DeleteService

func (c *AmbariClient) DeleteService(clusterName string, serviceName string) error

DeleteService permit to delete an existing service Before to delete service, it need to stop service and then delete all components It return error if service is not found

func (*AmbariClient) DisableVerifySSL

func (c *AmbariClient) DisableVerifySSL()

DisableVerifySSL permit to disable the SSL certificat check when call Ambari webservice

func (*AmbariClient) Host

func (c *AmbariClient) Host(hostname string) (*Host, error)

Host permit to get host from hostname It return host if is found It return nil if is not found It return error if something wrong when it call the API

func (*AmbariClient) HostComponent

func (c *AmbariClient) HostComponent(clusterName string, hostname string, componentName string) (*HostComponent, error)

HostComponent permit to load the host component It return the host component or nil if the component is not found It return error if there are some error in API call.

func (*AmbariClient) HostOnCluster

func (c *AmbariClient) HostOnCluster(clusterName string, hostname string) (*Host, error)

HostOnCluster permit to get host from cluster It return host object if host is found on cluster It return nil if host not found on cluster It return error if somethink wrong when it cal the API

func (*AmbariClient) Hosts

func (c *AmbariClient) Hosts() ([]Host, error)

Hosts permit to get all ambari agent hosts It return slice of hosts (slice can be empty if there are no ambari agent) It return error if something wrong when it call the API

func (*AmbariClient) HostsOnCluster

func (c *AmbariClient) HostsOnCluster(clusterName string) ([]Host, error)

HostsOnCluster permit to get all hosts in cluster It return slice of host (the slice can't be empty if there are no host) It return error if something wrong in API call

func (*AmbariClient) InstallService

func (c *AmbariClient) InstallService(service *Service) (*Service, error)

InstallService permit to start the service installation It must have the service setting and component associated to host to work It return service if all work fine It return error if something wrong when it call the API

func (*AmbariClient) ManageKerberosOnCluster

func (c *AmbariClient) ManageKerberosOnCluster(cluster *Cluster) (*Cluster, error)

Ambari not support to manage cluster by ID. We need to use clusterName instead. It return cluster if all right fine It return error if something wrong when it call the API

func (*AmbariClient) Privilege

func (c *AmbariClient) Privilege(clusterName string, id int64) (*Privilege, error)

Privilege return existing privilege on cluster It return the pivilege if is found It return nil if not found It return error if something wrong when it call the API

func (*AmbariClient) RegisterHostOnCluster

func (c *AmbariClient) RegisterHostOnCluster(clusterName string, hostname string, blueprintName string, role string) (*Host, error)

RegisterHostOnCluster permit to register new host on cluster and associate it to existant host group in blueprint It return host if all work fine It return error if host is not found by Ambari or if cluster is not found or if blueprint is not found or if role not exist in blueprint or something wrong when it call the API

func (*AmbariClient) RenameCluster

func (c *AmbariClient) RenameCluster(oldClusterName string, cluster *Cluster) (*Cluster, error)

Ambari not support to manage cluster by ID. We need to use clusterName instead. So we need to have the old cluster name is the goal to rename it. It return cluster if all right fine It return error if something wrong when it call the API

func (*AmbariClient) Repository

func (c *AmbariClient) Repository(stackName string, stackVersion string, repositoryId int) (*Repository, error)

Repository permit to get existing repository It return repository if is found It return nil if is not found

func (*AmbariClient) Request

func (c *AmbariClient) Request(clusterName string, Id int) (*RequestTask, error)

Request permit to get request by is name It return RequestTask if is found It return nil is request is not found It return error if something wrong with the API call

func (*AmbariClient) Requests

func (c *AmbariClient) Requests(clusterName string) ([]RequestTask, error)

Requests permit to get all requests It return the list of requestTask It return empty list if there are no tasks It return error if something wrong with the API call

func (*AmbariClient) SearchPrivilege

func (c *AmbariClient) SearchPrivilege(clusterName string, permissionName string, principalName string, principalType string) (*Privilege, error)

SearchPrivilege permit to get privilege by is name It return privielege if is found It return nil if is not found It return error if something wrong when it call the API

func (*AmbariClient) SearchRepository

func (c *AmbariClient) SearchRepository(stackName string, stackVersion string, repositoryName string, repositoryVersion string) (*Repository, error)

SearchRepository permit to get existing repository by is name It return the repository if is found It return nil if is not found It return error if something wrong when it call the API

func (*AmbariClient) SendRequestCluster

func (c *AmbariClient) SendRequestCluster(request *Request) (*RequestTask, error)

SendRequestCluster permit to start / stop service on ambari with message displayed on operation task in Ambari UI It keep only Kerberos field when it send the request It return RequestTask if all work fine It return nil if no request is created It return error if something wrong when it call the API

func (*AmbariClient) SendRequestHostComponent

func (c *AmbariClient) SendRequestHostComponent(request *Request) (*RequestTask, error)

SendRequestHostComponent permit to start / stop host component on ambari with message displayed on operation task in Ambari UI It keep only State field when it send the request It return RequestTask if all work fine It return nil if no request is created It return error if something wrong when it call the API

func (*AmbariClient) SendRequestService

func (c *AmbariClient) SendRequestService(request *Request) (*RequestTask, error)

SendRequestService permit to start / stop service on ambari with message displayed on operation task in Ambari UI It keep only State and MaintenanceState field when it send the request It return RequestTask if all work fine It return nil if no request is created It return error if something wrong when it call the API

func (*AmbariClient) Service

func (c *AmbariClient) Service(clusterName string, serviceName string) (*Service, error)

Service permit to get service by is name It return Service if is found It return nil is service is not found It return error if something wrong with the API call

func (*AmbariClient) SetClient

func (c *AmbariClient) SetClient(client *resty.Client)

Pertmit to set custom resty.Client for advance option

func (*AmbariClient) StartAllComponentsInHost

func (c *AmbariClient) StartAllComponentsInHost(clusterName string, hostname string, disableMaintenanceMode bool) error

StartAllComponentsInHost permit to start all components in arbitrary order If disableMaintenanceMode is set to true, it will remove maintenance mode on host before start all components If maintenanceState is set to on, it will do nothink It return error if host is not found or something wrong when it call the API

func (*AmbariClient) StartAllServices

func (c *AmbariClient) StartAllServices(cluster *Cluster, disableMaintenanceMode bool) error

StartAllServices start all services in HDP cluster. If disableMaintenanceMode is set to true, it will remove the meaintenance state in all services before start all services. In this way, all services will start. It return error if cluster not exist or if API call failed.

func (*AmbariClient) StartHostComponent

func (c *AmbariClient) StartHostComponent(clusterName string, hostname string, componentName string) (*HostComponent, error)

StartHostComponent permit to start component on host It will check that the component is not on client category, because it can't start. It return the HostComponent It will return error if component is not found or if there are some error on API call

func (*AmbariClient) StartService

func (c *AmbariClient) StartService(clusterName string, serviceName string, disableMaintenanceMode bool) (*Service, error)

StartService start the HDP service If you set disableMaintenanceMode to true, it will start the service even if maintenance state was ON If not, it will not stay that the service run because of it can't run it If disableMaintenanceMode is set to true, it will disable maintenance state before start the service

func (*AmbariClient) StopAllComponentsInHost

func (c *AmbariClient) StopAllComponentsInHost(clusterName string, hostname string, enableMaintenanceMode bool, force bool) error

StopAllComponentsInHost stop all components in host in arbitrary order if enableMaintenanceMode is set to true, it will enable maintenance state in host after stop all ressources if force is set to true, it will remove maintenance state in host before stop all ressources

func (*AmbariClient) StopAllServices

func (c *AmbariClient) StopAllServices(cluster *Cluster, enableMaintenanceMode bool, force bool) error

StopAllServices stop all services in HDP cluster. If enableMaintenanceMode is set to true, it will put all services in maintenance state after stopped all services. If force is set to true, it will remove maintenance state in all services before stop all services. In this way, it will stop all services. It returns error if the cluster not exist or if API call failed

func (*AmbariClient) StopHostComponent

func (c *AmbariClient) StopHostComponent(clusterName string, hostname string, componentName string) (*HostComponent, error)

StopHostComponent permit to stop component on host It return the HostComponent Not wait that host component is stopped if service is in maintenance state or if host is in maintenance state, because it can't stop it It will return error if component is not found or if there are some error on API call

func (*AmbariClient) StopService

func (c *AmbariClient) StopService(clusterName string, serviceName string, enableMaintenanceMode bool, force bool) (*Service, error)

StopService stop the HDP service If force is set to true, It will disable maintenance state before stop the service It not, It will not stay that the service stop because of it can't stop it. If enableMaintenanceMode is set to true, it will enable maintenance state after stopped the service

func (*AmbariClient) UpdateCredential

func (c *AmbariClient) UpdateCredential(credential *Credential) (*Credential, error)

UpdateCredential permit to update existing credential It return the credential if all work fine It return error if something wrong when it call the API

func (*AmbariClient) UpdateHost

func (c *AmbariClient) UpdateHost(host *Host) (*Host, error)

UpdateHost permit to update host like maintenance state It return updated host objcet if all work fine It return error if something wrong when it call the API

func (*AmbariClient) UpdateHostComponent

func (c *AmbariClient) UpdateHostComponent(hostComponent *HostComponent) (*HostComponent, error)

UpdateHostComponent permit to update the host component It return the host component It return error if the host component is not found or if there are some error in API call

func (*AmbariClient) UpdatePrivilege

func (c *AmbariClient) UpdatePrivilege(clusterName string, privilege *Privilege) (*Privilege, error)

UpdatePrivilege permit to update existing privielege

func (*AmbariClient) UpdateRepository

func (c *AmbariClient) UpdateRepository(repository *Repository) (*Repository, error)

UpdateRepository permit to update an existing repository like a repo URL It return updated repository if all work fine It return nil if something wrong when it call the API

func (*AmbariClient) UpdateService

func (c *AmbariClient) UpdateService(service *Service) (*Service, error)

UpdateService permit to update an existing sevice like service state It return updated Service if all work fine It return error if something wrong when it call the API

type AmbariError

type AmbariError struct {
	Code    int
	Message string
}

func NewAmbariError

func NewAmbariError(code int, message string, params ...interface{}) AmbariError

func (AmbariError) Error

func (e AmbariError) Error() string

type Blueprint

type Blueprint struct {
	Configurations []map[string]map[string]map[string]string `json:"configurations"`
	HostGroups     []HostGroup                               `json:"host_groups"`
	BlueprintInfo  BlueprintInfo                             `json:"Blueprints"`
}

Blueprint Json object

func (*Blueprint) String

func (b *Blueprint) String() string

String return blueprint object as Json string

type BlueprintInfo

type BlueprintInfo struct {
	Name    string `json:"blueprint_name,omitempty"`
	Stack   string `json:"stack_name"`
	Version string `json:"stack_version"`
}

type Cluster

type Cluster struct {
	ClusterInfo       *ClusterInfo                 `json:"Clusters"`
	Services          []Service                    `json:"services,omitempty"`
	DesiredConfigs    map[string]Configuration     `json:"desired_config,omitempty"`
	SessionAttributes map[string]map[string]string `json:"session_attributes,omitempty"`
}

Cluster item

func (*Cluster) CleanBeforeSave

func (c *Cluster) CleanBeforeSave()

func (*Cluster) String

func (c *Cluster) String() string

String permit to return cluster object as Json string

type ClusterInfo

type ClusterInfo struct {
	ClusterId    int64  `json:"cluster_id,omitempty"`
	ClusterName  string `json:"cluster_name"`
	Version      string `json:"version,omitempty"`
	SecurityType string `json:"security_type,omitempty"`
}

type Component

type Component struct {
	ComponentInfo  *ComponentInfo  `json:"ServiceComponentInfo"`
	HostComponents []HostComponent `json:"host_components"`
}

func (*Component) String

func (s *Component) String() string

String permit to return Component as Json string

type ComponentInfo

type ComponentInfo struct {
	ClusterName   string `json:"cluster_name,omitempty"`
	ServiceName   string `json:"service_name,omitempty"`
	ComponentName string `json:"component_name,omitempty"`
	State         string `json:"state,omitempty"`
	Category      string `json:"category,omitempty"`
}

type Configuration

type Configuration struct {
	Type       string            `json:"type,omitempty"`
	Tag        string            `json:"tag,omitempty"`
	Properties map[string]string `json:"properties,omitempty"`
}

Object item

func (*Configuration) String

func (c *Configuration) String() string

String permit to return Configuration as Json string

type Credential

type Credential struct {
	CredentialInfo *CredentialInfo `json:"Credential"`
}

Credential object

func (*Credential) CleanBeforeSave

func (c *Credential) CleanBeforeSave() *Credential

Clean object before save or update it

func (*Credential) String

func (c *Credential) String() string

String return credential object as Json string

type CredentialInfo

type CredentialInfo struct {
	Alias       string `json:"alias,omitempty"`
	ClusterName string `json:"cluster_name,omitempty"`
	Principal   string `json:"principal,omitempty"`
	Key         string `json:"key,omitempty"`
	Type        string `json:"type,omitempty"`
}

type CredentialResponse

type CredentialResponse struct {
	Response
	Items []Credential `json:"items"`
}

type DesiredConfig

type DesiredConfig struct {
	DesiredConfig *Configuration `json:"desired_config,omitempty"`
}

type Host

type Host struct {
	HostInfo       *HostInfo       `json:"Hosts"`
	HostComponents []HostComponent `json:"host_components,omitempty"`
}

Host object

func (*Host) CleanBeforeSave

func (h *Host) CleanBeforeSave()

CleanBeforeSave permit to remove some attribute before save or update host

func (*Host) String

func (h *Host) String() string

String return host oject as Json string

type HostBlueprint

type HostBlueprint struct {
	Blueprint string `json:"blueprint,omitempty"`
	HostGroup string `json:"host_group,omitempty"`
}

type HostComponent

type HostComponent struct {
	HostComponentInfo *HostComponentInfo `json:"HostRoles"`
}

Object that reflect the Ambari API

func (*HostComponent) CleanBeforeSave

func (h *HostComponent) CleanBeforeSave()

func (*HostComponent) String

func (h *HostComponent) String() string

String permit to display the struct as JSON object

type HostComponentInfo

type HostComponentInfo struct {
	ClusterName   string                 `json:"cluster_name,omitempty"`
	ComponentName string                 `json:"component_name,omitempty"`
	Hostname      string                 `json:"host_name,omitempty"`
	State         string                 `json:"state,omitempty"`
	DesiredState  string                 `json:"desired_state,omitempty"`
	ServiceName   string                 `json:"service_name,omitempty"`
	HaState       string                 `json:"ha_state,omitempty"`
	Metrics       map[string]interface{} `json:"metrics,omitempty"`
}

type HostGroup

type HostGroup struct {
	Components     []map[string]string                       `json:"components"`
	Configurations []map[string]map[string]map[string]string `json:"configurations"`
	Name           string                                    `json:"name"`
	Cardinality    string                                    `json:"cardinality"`
}

type HostInfo

type HostInfo struct {
	ClusterName      string `json:"cluster_name,omitempty"`
	Hostname         string `json:"host_name,omitempty"`
	MaintenanceState string `json:"maintenance_state,omitempty"`
	Rack             string `json:"rack_info,omitempty"`
}

type Hosts

type Hosts struct {
	Items []Host `json:"items,omitempty"`
}

type OS

type OS struct {
	Response
	OSInfo           *OSInfo          `json:"OperatingSystems"`
	RepositoriesData []RepositoryData `json:"repositories"`
}

type OSInfo

type OSInfo struct {
	Type              string `json:"os_type"`
	ManagedRepository bool   `json:"ambari_managed_repositories, omitempty"`
}

type Privilege

type Privilege struct {
	PrivilegeInfo *PrivilegeInfo `json:"PrivilegeInfo"`
}

Privilege object

func (*Privilege) String

func (p *Privilege) String() string

String return privilege object as Json string

type PrivilegeInfo

type PrivilegeInfo struct {
	PrivilegeId     int64  `json:"privilege_id,omitempty"`
	PermissionLabel string `json:"permission_label,omitempty"`
	PermissionName  string `json:"permission_name"`
	PrincipalName   string `json:"principal_name"`
	PrincipalType   string `json:"principal_type"`
}

type PrivilegesResponse

type PrivilegesResponse struct {
	Response
	Items []Privilege `json:"items"`
}

type RepositoriesResponse

type RepositoriesResponse struct {
	Response
	Items []Repository `json:"items"`
}

type Repository

type Repository struct {
	RepositoryVersion *RepositoryVersion `json:"RepositoryVersions"`
	OS                []OS               `json:"operating_systems"`
}

Repository object

func (*Repository) CleanBeforeSave

func (r *Repository) CleanBeforeSave()

CleanBeforeSave permit to clean some attributes before to save or update repository

func (*Repository) String

func (r *Repository) String() string

String return repository object as Json string

type RepositoryData

type RepositoryData struct {
	Response
	RepositoryInfo *RepositoryInfo `json:"Repositories"`
}

type RepositoryInfo

type RepositoryInfo struct {
	Id      string `json:"repo_id"`
	Name    string `json:"repo_name"`
	BaseUrl string `json:"base_url"`
}

type RepositoryVersion

type RepositoryVersion struct {
	Id           int    `json:"id,omitempty"`
	Version      string `json:"repository_version"`
	Name         string `json:"display_name"`
	StackName    string `json:"stack_name,omitempty"`
	StackVersion string `json:"stack_version,omitempty"`
}

type Request

type Request struct {
	RequestInfo *RequestInfo `json:"RequestInfo"`
	Body        interface{}  `json:"Body"`
}

func (*Request) String

func (r *Request) String() string

String permit to get request object as Json string

type RequestAddConfig

type RequestAddConfig struct {
	Cluster *DesiredConfig `json:"Clusters,omitempty"`
}

type RequestInfo

type RequestInfo struct {
	Context string `json:"context"`
	Query   string `json:"query,omitempty"`
}

type RequestTask

type RequestTask struct {
	RequestTaskInfo *RequestTaskInfo `json:"Requests,omitempty"`
}

func (*RequestTask) String

func (r *RequestTask) String() string

String permit to get Request object as Json string

func (*RequestTask) Wait

func (r *RequestTask) Wait(c *AmbariClient, clusterName string) error

Permit to wait the rerquest task is finished It can return error if API call failed

type RequestTaskInfo

type RequestTaskInfo struct {
	Id              int     `json:"id,omitempty"`
	CompletedTask   int     `json:"completed_task_count,omitempty"`
	AbordedTask     int     `json:"aborted_task_count,omitempty"`
	FailedTask      int     `json:"failed_task_count,omitempty"`
	TaskCount       int     `json:"task_count,omitempty"`
	ProgressPercent float64 `json:"progress_percent,omitempty"`
	Status          string  `json:"request_status,omitempty"`
	Context         string  `json:"request_context,omitempty"`
	ClusterName     string  `json:"cluster_name,omitempty"`
}

type RequestsTask

type RequestsTask struct {
	Items []RequestTask `json:"Items"`
}

func (*RequestsTask) String

func (r *RequestsTask) String() string

String permit to get Request object as Json string

type Response

type Response struct {
	Href *string `json:"href,omitempty"`
}

type Service

type Service struct {
	ServiceInfo *ServiceInfo `json:"ServiceInfo"`
	Components  []Component  `json:"components,omitempty"`
}

Service object

func (*Service) CleanBeforeSave

func (s *Service) CleanBeforeSave()

ClearBeforeSave permit to clean service before save or update it

func (*Service) String

func (s *Service) String() string

String permit to get service object as Json string

type ServiceInfo

type ServiceInfo struct {
	ClusterName      string `json:"cluster_name,omitempty"`
	ServiceName      string `json:"service_name,omitempty"`
	State            string `json:"state,omitempty"`
	RepositoryId     int    `json:"desired_repository_version_id,omitempty"`
	MaintenanceState string `json:"maintenance_state,omitempty"`
}

Jump to

Keyboard shortcuts

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