Documentation ¶
Index ¶
- func CreateCredential(apiKey string, credential Credential) (*http.Response, error)
- func DeleteCredential(apiKey, uuid string) error
- func UpdateCredential(apiKey, uuid string, update CredentialUpdate) error
- type Credential
- type CredentialDetail
- type CredentialList
- type CredentialUpdate
- type ErrorResponse
- type Permission
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCredential ¶
func CreateCredential(apiKey string, credential Credential) (*http.Response, error)
CreateCredential creates a new managed credential in Tenable.io.
func DeleteCredential ¶
DeleteCredential deletes a managed credential by its UUID.
func UpdateCredential ¶
func UpdateCredential(apiKey, uuid string, update CredentialUpdate) error
UpdateCredential updates the details of a managed credential by its UUID.
Types ¶
type Credential ¶
type Credential struct { Name string `json:"name"` Description string `json:"description,omitempty"` Type string `json:"type"` Settings map[string]interface{} `json:"settings"` Permissions []Permission `json:"permissions,omitempty"` }
Credential represents the request body for creating a new credential.
type CredentialDetail ¶
type CredentialDetail struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description,omitempty"` Type string `json:"type"` Settings map[string]interface{} `json:"settings"` Permissions []Permission `json:"permissions,omitempty"` }
CredentialDetail represents the details of a managed credential returned by Tenable.io.
func GetCredentialDetail ¶
func GetCredentialDetail(apiKey, uuid string) (*CredentialDetail, error)
GetCredentialDetail fetches the details of a managed credential by its UUID.
type CredentialList ¶
type CredentialList struct { Credentials []struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description,omitempty"` Type string `json:"type"` } `json:"credentials"` // Assuming the response includes some form of pagination or total count Total int `json:"total"` }
CredentialList represents a list of managed credentials.
func ListCredentials ¶
func ListCredentials(apiKey string, options ...func(*url.Values)) (*CredentialList, error)
ListCredentials fetches a list of managed credentials with optional filtering and pagination.
type CredentialUpdate ¶
type CredentialUpdate struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` AdHoc *bool `json:"ad_hoc,omitempty"` Settings map[string]interface{} `json:"settings,omitempty"` Permissions []Permission `json:"permissions,omitempty"` }
CredentialUpdate represents the body for updating a managed credential.
type ErrorResponse ¶
ErrorResponse represents a typical error response from the API.
type Permission ¶
type Permission struct { Type string `json:"type"` Value int `json:"value"` GranteeID string `json:"grantee_uuid,omitempty"` // Adjust as needed based on actual API requirements }
Permission represents user permissions for the managed credential.