Documentation ¶
Index ¶
- Constants
- type Alert
- type AlertInfo
- type Alerts
- type AmbariClient
- func (c *AmbariClient) Alerts(clusterName string) ([]Alert, error)
- func (c *AmbariClient) AlertsInCluster(clusterName string) ([]Alert, error)
- func (c *AmbariClient) AlertsInHost(clusterName string, hostname string) ([]Alert, error)
- func (c *AmbariClient) AlertsInService(clusterName string, serviceName string) ([]Alert, error)
- func (c *AmbariClient) Blueprint(name string) (*Blueprint, error)
- func (c *AmbariClient) Client() *resty.Client
- func (c *AmbariClient) Cluster(clusterName string) (*Cluster, error)
- func (c *AmbariClient) Component(clusterName string, serviceName string, componentName string) (*Component, error)
- func (c *AmbariClient) CreateBlueprint(name string, jsonBlueprint string) (*Blueprint, error)
- func (c *AmbariClient) CreateCluster(cluster *Cluster) (*Cluster, error)
- func (c *AmbariClient) CreateClusterFromTemplate(name string, jsonClusterTemplate string) (*Cluster, error)
- func (c *AmbariClient) CreateComponent(component *Component) (*Component, error)
- func (c *AmbariClient) CreateConfigurationOnCluster(clusterName string, configuration *Configuration) (*Cluster, error)
- func (c *AmbariClient) CreateCredential(credential *Credential) (*Credential, error)
- func (c *AmbariClient) CreateHost(host *Host) (*Host, error)
- func (c *AmbariClient) CreateHostComponent(hostComponent *HostComponent) (*HostComponent, error)
- func (c *AmbariClient) CreatePrivilege(clusterName string, privilege *Privilege) (*Privilege, error)
- func (c *AmbariClient) CreateRepository(repository *Repository) (*Repository, error)
- func (c *AmbariClient) CreateService(service *Service) (*Service, error)
- func (c *AmbariClient) Credential(clusterName string, alias string) (*Credential, error)
- func (c *AmbariClient) Credentials(clusterName string) ([]Credential, error)
- func (c *AmbariClient) DeleteAllComponentsInHost(clusterName string, hostname string, disableMaintenanceMode bool) error
- func (c *AmbariClient) DeleteBlueprint(name string) error
- func (c *AmbariClient) DeleteCluster(clusterName string) error
- func (c *AmbariClient) DeleteComponent(clusterName string, serviceName string, componentName string) error
- func (c *AmbariClient) DeleteCredential(clusterName string, alias string) error
- func (c *AmbariClient) DeleteHost(clusterName string, hostname string) error
- func (c *AmbariClient) DeleteHostComponent(clusterName string, hostname string, componentName string) error
- func (c *AmbariClient) DeletePrivilege(clusterName string, id int64) error
- func (c *AmbariClient) DeleteRepository(stackName string, stackVersion string, repositoryId int) error
- func (c *AmbariClient) DeleteService(clusterName string, serviceName string) error
- func (c *AmbariClient) DisableVerifySSL()
- func (c *AmbariClient) Host(hostname string) (*Host, error)
- func (c *AmbariClient) HostComponent(clusterName string, hostname string, componentName string) (*HostComponent, error)
- func (c *AmbariClient) HostOnCluster(clusterName string, hostname string) (*Host, error)
- func (c *AmbariClient) Hosts() ([]Host, error)
- func (c *AmbariClient) HostsOnCluster(clusterName string) ([]Host, error)
- func (c *AmbariClient) InstallService(service *Service) (*Service, error)
- func (c *AmbariClient) ManageKerberosOnCluster(cluster *Cluster) (*Cluster, error)
- func (c *AmbariClient) Privilege(clusterName string, id int64) (*Privilege, error)
- func (c *AmbariClient) RegisterHostOnCluster(clusterName string, hostname string, blueprintName string, role string) (*Host, error)
- func (c *AmbariClient) RenameCluster(oldClusterName string, cluster *Cluster) (*Cluster, error)
- func (c *AmbariClient) Repository(stackName string, stackVersion string, repositoryId int) (*Repository, error)
- func (c *AmbariClient) Request(clusterName string, Id int) (*RequestTask, error)
- func (c *AmbariClient) Requests(clusterName string) ([]RequestTask, error)
- func (c *AmbariClient) SearchPrivilege(clusterName string, permissionName string, principalName string, ...) (*Privilege, error)
- func (c *AmbariClient) SearchRepository(stackName string, stackVersion string, repositoryName string, ...) (*Repository, error)
- func (c *AmbariClient) SendRequestCluster(request *Request) (*RequestTask, error)
- func (c *AmbariClient) SendRequestHostComponent(request *Request) (*RequestTask, error)
- func (c *AmbariClient) SendRequestService(request *Request) (*RequestTask, error)
- func (c *AmbariClient) Service(clusterName string, serviceName string) (*Service, error)
- func (c *AmbariClient) SetClient(client *resty.Client)
- func (c *AmbariClient) StartAllComponentsInHost(clusterName string, hostname string, disableMaintenanceMode bool) error
- func (c *AmbariClient) StartAllServices(cluster *Cluster, disableMaintenanceMode bool) error
- func (c *AmbariClient) StartHostComponent(clusterName string, hostname string, componentName string) (*HostComponent, error)
- func (c *AmbariClient) StartService(clusterName string, serviceName string, disableMaintenanceMode bool) (*Service, error)
- func (c *AmbariClient) StopAllComponentsInHost(clusterName string, hostname string, enableMaintenanceMode bool, force bool) error
- func (c *AmbariClient) StopAllServices(cluster *Cluster, enableMaintenanceMode bool, force bool) error
- func (c *AmbariClient) StopHostComponent(clusterName string, hostname string, componentName string) (*HostComponent, error)
- func (c *AmbariClient) StopService(clusterName string, serviceName string, enableMaintenanceMode bool, force bool) (*Service, error)
- func (c *AmbariClient) UpdateCredential(credential *Credential) (*Credential, error)
- func (c *AmbariClient) UpdateHost(host *Host) (*Host, error)
- func (c *AmbariClient) UpdateHostComponent(hostComponent *HostComponent) (*HostComponent, error)
- func (c *AmbariClient) UpdatePrivilege(clusterName string, privilege *Privilege) (*Privilege, error)
- func (c *AmbariClient) UpdateRepository(repository *Repository) (*Repository, error)
- func (c *AmbariClient) UpdateService(service *Service) (*Service, error)
- type AmbariError
- type Blueprint
- type BlueprintInfo
- type Cluster
- type ClusterInfo
- type Component
- type ComponentInfo
- type Configuration
- type Credential
- type CredentialInfo
- type CredentialResponse
- type DesiredConfig
- type Host
- type HostBlueprint
- type HostComponent
- type HostComponentInfo
- type HostGroup
- type HostInfo
- type Hosts
- type OS
- type OSInfo
- type Privilege
- type PrivilegeInfo
- type PrivilegesResponse
- type RepositoriesResponse
- type Repository
- type RepositoryData
- type RepositoryInfo
- type RepositoryVersion
- type Request
- type RequestAddConfig
- type RequestInfo
- type RequestTask
- type RequestTaskInfo
- type RequestsTask
- type Response
- type Service
- type ServiceInfo
Constants ¶
const ( CREDENTIAL_TEMPORARY = "temporary" CREDENTIAL_PERSISTED = "persisted" )
const ( SERVICE_STARTED = "STARTED" SERVICE_STOPPED = "INSTALLED" SERVICE_INSTALLED = "INSTALLED" SERVICE_UNKNOWN = "UNKNOWN" SERVICE_INIT = "INIT" MAINTENANCE_STATE_ON = "ON" MAINTENANCE_STATE_OFF = "OFF" )
const ( REQUEST_FAILED = "FAILED" REQUEST_ACCEPTED = "ACCEPTED" REQUEST_COMPLETED = "COMPLETED" REQUEST_ABORDED = "ABORDED" )
const (
COMPONENT_CLIENT = "CLIENT"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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) 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 ¶
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
type BlueprintInfo ¶
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()
type ClusterInfo ¶
type Component ¶
type Component struct { ComponentInfo *ComponentInfo `json:"ServiceComponentInfo"` HostComponents []HostComponent `json:"host_components"` }
type ComponentInfo ¶
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 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
type HostBlueprint ¶
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 OS ¶
type OS struct { Response OSInfo *OSInfo `json:"OperatingSystems"` RepositoriesData []RepositoryData `json:"repositories"` }
type Privilege ¶
type Privilege struct {
PrivilegeInfo *PrivilegeInfo `json:"PrivilegeInfo"`
}
Privilege object
type PrivilegeInfo ¶
type PrivilegesResponse ¶
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 RepositoryVersion ¶
type Request ¶
type Request struct { RequestInfo *RequestInfo `json:"RequestInfo"` Body interface{} `json:"Body"` }
type RequestAddConfig ¶
type RequestAddConfig struct {
Cluster *DesiredConfig `json:"Clusters,omitempty"`
}
type RequestInfo ¶
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 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