Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOpts ¶
type CreateOpts struct {
// Host group name.
// Use only letters, digits, underscores (_), hyphens (-), and periods (.).
// Do not start with a period or underscore or end with a period.
Name string `json:"host_group_name" required:"true"`
// Host group type.
// Windows
// Linux
Type string `json:"host_group_type" required:"true"`
// List of host group IDs. The host type must be the same as the host group type.
HostIdList []string `json:"host_id_list,omitempty"`
// Host access type.
// LABEL
// IP
AgentAccessType string `json:"agent_access_type,omitempty"`
// Host group identifier. If the host access type is LABEL, this field saves the host group identifier.
Labels []string `json:"labels,omitempty"`
// Tag information. You can add up to 20 tags.
Tags []tags.ResourceTag `json:"host_group_tag,omitempty"`
}
CreateOpts is a struct that contains all the parameters.
type DeleteOpts ¶
type DeleteOpts struct {
HostGroupIds []string `json:"host_group_id_list" required:"true"`
}
type DeleteResult ¶
type DeleteResult struct {
// Host group details.
Result []HostGroupResponse `json:"result"`
// Number of deleted host groups.
Total int64 `json:"total"`
}
DeleteResult represents the API response after deletion
func Delete ¶
func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) (*DeleteResult, error)
Delete a host group by id
type Filter ¶
type Filter struct {
// Host group type.
// Windows
// Linux
Type string `json:"host_group_type,omitempty"`
// List of host group names.
HostGroupNameList []string `json:"host_group_name_list,omitempty"`
// Host name list.
HostNameList []string `json:"host_name_list,omitempty"`
// Host group tags.
HostGroupTag []ListTag `json:"host_group_tag,omitempty"`
}
type HostFilter ¶
type HostFilter struct {
// Host name list.
HostNameList []string `json:"host_name_list,omitempty"`
// List of host IP addresses. You can filter hosts by host IP address.
HostIpList []string `json:"host_ip_list,omitempty"`
// Host status. You can filter hosts by host status.
// uninstall: not installed.
// running: running.
// offline: offline.
// error: abnormal.
// plugin error: plug-in error.
// installing: installing.
// install-fail: Installation failed.
// upgrading: upgrading.
// upgrade failed: Upgrade failed.
// uninstalling: being uninstalled.
// authentication error: Authentication failed.
Status string `json:"host_status,omitempty"`
// Host version. You can filter hosts by host version.
HostVersion string `json:"host_version,omitempty"`
}
type HostGroupResponse ¶
type HostGroupResponse struct {
// Host group ID.
ID string `json:"host_group_id"`
// Host group name.
Name string `json:"host_group_name"`
// Host group type.
Type string `json:"host_group_type"`
// Host ID list.
HostIdList []string `json:"host_id_list"`
// Tag information.
Tags []tags.ResourceTag `json:"host_group_tag"`
// Creation time.
CreatedAt int64 `json:"create_time"`
// Update time.
UpdatedAt int64 `json:"update_time"`
// Host group ID.
Labels []string `json:"labels"`
// Host access type.
AgentAccessType string `json:"agent_access_type"`
}
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*HostGroupResponse, error)
func Update ¶
func Update(client *golangsdk.ServiceClient, opts UpdateLogGroupOpts) (*HostGroupResponse, error)
type HostResponse ¶
type HostResponse struct {
// Host ID.
ID string `json:"host_id"`
// Host IP.
IP string `json:"host_ip"`
// Host name.
HostName string `json:"host_name"`
// Host status.
HostStatus string `json:"host_status"`
// Host type.
Type string `json:"host_type"`
// Host version.
HostVersion string `json:"host_version"`
// Update time.
UpdatedAt int64 `json:"update_time"`
}
type ListHostOpts ¶
type ListHostOpts struct {
// List of host group IDs. The host type must be the same as the host group type.
HostIdList []string `json:"host_id_list,omitempty"`
// Filters other than host IDs.
Filter *HostFilter `json:"filter,omitempty"`
}
type ListHostResult ¶
type ListHostResult struct {
// Host group details.
Result []HostResponse `json:"result"`
// Number of deleted host groups.
Total int64 `json:"total"`
}
func ListHost ¶
func ListHost(client *golangsdk.ServiceClient, opts ListHostOpts) (*ListHostResult, error)
type ListResult ¶
type ListResult struct {
// Host group details.
Result []HostGroupResponse `json:"result"`
// Number of deleted host groups.
Total int64 `json:"total"`
}
func List ¶
func List(client *golangsdk.ServiceClient, opts ListOpts) (*ListResult, error)
type ListTag ¶
type ListTag struct {
// Tag type. Tag filtering logic: `AND` or `OR`.
Type string `json:"tag_type,omitempty"`
// Host group tags.
Tags []tags.ResourceTag `json:"tag_list,omitempty"`
}
type UpdateLogGroupOpts ¶
type UpdateLogGroupOpts struct {
// Host group ID.
ID string `json:"host_group_id" required:"true"`
// Host group name.
// Use only letters, digits, underscores (_), hyphens (-), and periods (.).
// Do not start with a period or underscore or end with a period.
Name string `json:"host_group_name,omitempty"`
// Host ID list. The host type must be the same as the host group type.
HostIdList *[]string `json:"host_id_list,omitempty"`
// Host group tags. A key must be unique. Up to 20 keys are allowed.
Tags *[]tags.ResourceTag `json:"host_group_tag,omitempty"`
// Host group identifier. If the host access type is LABEL, this field saves the host group identifier.
Labels *[]string `json:"labels,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.