Documentation
¶
Index ¶
- Constants
- func FindObject(sourceArray []interface{}, fieldName string, compareData interface{}) (index int)
- func FindObjectByStringRegex(sourceArray []interface{}, fieldName string, regex string) (index int, err error)
- func GetInterfaceArrayFromJCCommand(commands []JCCommand) (interfaceArray []interface{})
- func GetInterfaceArrayFromJCCommandResults(commandResults []JCCommandResult) (interfaceArray []interface{})
- func GetInterfaceArrayFromJCRadiusServer(radiusServers []JCRadiusServer) (interfaceArray []interface{})
- func GetInterfaceArrayFromJCSystems(systems []JCSystem) (interfaceArray []interface{})
- func GetTagNames(tags []JCTag) []string
- func GetTrueOrFalse(input interface{}) bool
- func MapJCOpToHTTP(op JCOp) string
- func SystemsToString(systems []JCSystem) string
- func UsersToString(users []JCUser) string
- type JCAPI
- func (jc JCAPI) AddUpdateCommand(op JCOp, command JCCommand) (commandResult JCCommand, err JCError)
- func (jc JCAPI) AddUpdateIDSource(op JCOp, idSource JCIDSource) (string, JCError)
- func (jc JCAPI) AddUpdateRadiusServer(op JCOp, radiusServer JCRadiusServer) (id string, err JCError)
- func (jc JCAPI) AddUpdateTag(op JCOp, tag JCTag) (tagId string, err JCError)
- func (jc JCAPI) AddUpdateUser(op JCOp, user JCUser) (userId string, err JCError)
- func (jc JCAPI) AuthUser(username, password, tag string) (userAuthenticated bool, err error)
- func (jc JCAPI) Delete(url string) (interface{}, JCError)
- func (jc JCAPI) DeleteCommand(command JCCommand) JCError
- func (jc JCAPI) DeleteCommandResult(id string) (err JCError)
- func (jc JCAPI) DeleteIDSource(idSource JCIDSource) JCError
- func (jc JCAPI) DeleteRadiusServer(radiusServer JCRadiusServer) JCError
- func (jc JCAPI) DeleteSystem(system JCSystem) JCError
- func (jc JCAPI) DeleteTag(tag JCTag) JCError
- func (jc JCAPI) DeleteUser(user JCUser) JCError
- func (jc JCAPI) Do(op, url string, data []byte) (interface{}, JCError)
- func (jc JCAPI) DoBytes(op, urlQuery string, data []byte) ([]byte, JCError)
- func (jc JCAPI) Get(url string) (interface{}, JCError)
- func (jc JCAPI) GetAllCommands() (commandList []JCCommand, err JCError)
- func (jc JCAPI) GetAllIDSources() (idSources []JCIDSource, err JCError)
- func (jc JCAPI) GetAllRadiusServers() (radiusServers []JCRadiusServer, err JCError)
- func (jc JCAPI) GetAllTags() (tagList []JCTag, err JCError)
- func (jc JCAPI) GetCommandResultDetailsById(id string) (commandResult JCCommandResult, err JCError)
- func (jc JCAPI) GetCommandResultsByName(name string) (commandResultList []JCCommandResult, err JCError)
- func (jc JCAPI) GetCommandResultsBySavedCommandID(id string) (commandResults []JCCommandResult, err JCError)
- func (jc JCAPI) GetIDSourceByName(name string) (idSource JCIDSource, exists bool, err JCError)
- func (jc JCAPI) GetSystemByHostName(hostname string, withTags bool) ([]JCSystem, JCError)
- func (jc JCAPI) GetSystemById(systemId string, withTags bool) (system JCSystem, err JCError)
- func (jc JCAPI) GetSystemUserBindingsById(systemId string) (systemUserBindings []SystemUserBinding, err JCError)
- func (jc JCAPI) GetSystemUserByEmail(email string, withTags bool) ([]JCUser, JCError)
- func (jc JCAPI) GetSystemUserById(userId string, withTags bool) (user JCUser, err JCError)
- func (jc JCAPI) GetSystemUsers(withTags bool) (userList []JCUser, err JCError)
- func (jc JCAPI) GetSystems(withTags bool) (systems []JCSystem, err JCError)
- func (jc JCAPI) GetTagByName(tagName string) (tag JCTag, err JCError)
- func (jc JCAPI) GetTagsByUrl(urlPath string) (tagList []JCTag, err JCError)
- func (jc JCAPI) HandleCommand(path string, op JCOp, command JCCommand) (commandResult JCCommand, err JCError)
- func (jc JCAPI) List(url string) (interface{}, JCError)
- func (jc JCAPI) Post(url string, data []byte) (interface{}, JCError)
- func (jc JCAPI) Put(url string, data []byte) (interface{}, JCError)
- func (jc JCAPI) RunCommand(command JCCommand) JCError
- func (jc JCAPI) SendUserActivationEmail(userList []JCUser) (err JCError)
- func (jc JCAPI) UpdateSystem(system JCSystem) (systemId string, err JCError)
- type JCCommand
- type JCCommandResult
- type JCCommandResultResults
- type JCCommandResults
- type JCData
- type JCError
- type JCIDSource
- type JCIDSourceResults
- type JCNetworkInterface
- type JCOp
- type JCRadiusServer
- type JCRadiusServerResults
- type JCResponse
- type JCRestAuth
- type JCSSHDParam
- type JCSystem
- type JCSystemResults
- type JCTag
- type JCTagResults
- type JCUser
- type JCUserAttribute
- type JCUserEmailRequest
- type SystemUserBinding
Constants ¶
const ( COMMAND_PATH string = "/commands" RUN_COMMAND_PATH string = "/runCommand" COMMAND_ROOT_USER string = "000000000000000000000000" )
const ( BAD_FIELD_NAME = -3 OBJECT_NOT_FOUND = -2 BAD_COMPARISON_TYPE = -1 )
const (
AUTHENTICATE_PATH string = "/authenticate"
)
const (
COMMAND_RESULTS_PATH string = "/commandresults"
)
const (
IDSOURCES_PATH string = "/idsources"
)
const (
RADIUS_SERVERS_PATH string = "/radiusservers"
)
const (
SYSTEMS_PATH string = "/systems"
)
const (
StdUrlBase = "https://console.jumpcloud.com/api"
)
const (
TAGS_PATH string = "/tags"
)
Variables ¶
This section is empty.
Functions ¶
func FindObject ¶
func FindObjectByStringRegex ¶
func GetInterfaceArrayFromJCCommand ¶
func GetInterfaceArrayFromJCCommand(commands []JCCommand) (interfaceArray []interface{})
func GetInterfaceArrayFromJCCommandResults ¶
func GetInterfaceArrayFromJCCommandResults(commandResults []JCCommandResult) (interfaceArray []interface{})
func GetInterfaceArrayFromJCRadiusServer ¶
func GetInterfaceArrayFromJCRadiusServer(radiusServers []JCRadiusServer) (interfaceArray []interface{})
func GetInterfaceArrayFromJCSystems ¶
func GetInterfaceArrayFromJCSystems(systems []JCSystem) (interfaceArray []interface{})
func GetTagNames ¶
func GetTrueOrFalse ¶
func GetTrueOrFalse(input interface{}) bool
func MapJCOpToHTTP ¶
func SystemsToString ¶
func UsersToString ¶
Types ¶
type JCAPI ¶
func (JCAPI) AddUpdateCommand ¶
Add or Update a command in place on JumpCloud
AddUpdateCommand returns an entire struct, so that the workflow ID can be obtained for running commands. This is a departure from other AddUpdate*() functions in this API, which generally just return the ID, because that is sufficient for most use cases.
func (JCAPI) AddUpdateIDSource ¶
func (jc JCAPI) AddUpdateIDSource(op JCOp, idSource JCIDSource) (string, JCError)
Add or Update an ID source in place on JumpCloud
func (JCAPI) AddUpdateRadiusServer ¶
func (jc JCAPI) AddUpdateRadiusServer(op JCOp, radiusServer JCRadiusServer) (id string, err JCError)
Add or Update a radiusserver in place on JumpCloud
func (JCAPI) AddUpdateTag ¶
Add or Update a tag in place on JumpCloud
func (JCAPI) AddUpdateUser ¶
Add or Update a new user to JumpCloud
func (JCAPI) DeleteCommand ¶
func (JCAPI) DeleteCommandResult ¶
func (JCAPI) DeleteIDSource ¶
func (jc JCAPI) DeleteIDSource(idSource JCIDSource) JCError
func (JCAPI) DeleteRadiusServer ¶
func (jc JCAPI) DeleteRadiusServer(radiusServer JCRadiusServer) JCError
func (JCAPI) DeleteSystem ¶
!!!!!!!!!!!!WARNING!!!!!!!!!!!!
This will cause JumpCloud to uninstall the agent on this system.
You will lose control of the system after the call returns.
func (JCAPI) DeleteUser ¶
func (JCAPI) Do ¶
DEPRECATED: This version of Do() will be replaced by the code in DoBytes() in the future, when the jcapi-systemuser issue is corrected to allow for marshalling and unmarshalling using the same object.
func (JCAPI) GetAllCommands ¶
func (JCAPI) GetAllIDSources ¶
func (jc JCAPI) GetAllIDSources() (idSources []JCIDSource, err JCError)
func (JCAPI) GetAllRadiusServers ¶
func (jc JCAPI) GetAllRadiusServers() (radiusServers []JCRadiusServer, err JCError)
func (JCAPI) GetAllTags ¶
func (JCAPI) GetCommandResultDetailsById ¶
func (jc JCAPI) GetCommandResultDetailsById(id string) (commandResult JCCommandResult, err JCError)
func (JCAPI) GetCommandResultsByName ¶
func (jc JCAPI) GetCommandResultsByName(name string) (commandResultList []JCCommandResult, err JCError)
func (JCAPI) GetCommandResultsBySavedCommandID ¶
func (jc JCAPI) GetCommandResultsBySavedCommandID(id string) (commandResults []JCCommandResult, err JCError)
func (JCAPI) GetIDSourceByName ¶
func (jc JCAPI) GetIDSourceByName(name string) (idSource JCIDSource, exists bool, err JCError)
func (JCAPI) GetSystemByHostName ¶
Executes a search by hostname via the JumpCloud API
func (JCAPI) GetSystemById ¶
func (JCAPI) GetSystemUserBindingsById ¶
func (jc JCAPI) GetSystemUserBindingsById(systemId string) (systemUserBindings []SystemUserBinding, err JCError)
GetSystemUserBindingsById returns all the user bindings for the given system Id: this includes the direct system-user bindings as well as the bindings made via tags
func (JCAPI) GetSystemUserByEmail ¶
Executes a search by email via the JumpCloud API
func (JCAPI) GetSystemUserById ¶
func (JCAPI) GetSystemUsers ¶
func (JCAPI) GetSystems ¶
func (JCAPI) GetTagsByUrl ¶
func (JCAPI) HandleCommand ¶
func (JCAPI) RunCommand ¶
func (JCAPI) SendUserActivationEmail ¶
Resend user email
type JCCommand ¶
type JCCommand struct { Id string `json:"_id,omitempty"` // unique database ID Name string `json:"name"` // a title for display in the UI Command string `json:"command"` // the actual command string to execute CommandRunners []string `json:"commandRunners,omitempty"` // Command Runner user IDs able to run this command CommandType string `json:"commandType"` // linux/windows/mac User string `json:"user,omitempty"` // user to run as (000000000000000000000000 for root) Files []string `json:"files,omitempty"` // list of files uploaded by the command Systems []string `json:"systems,omitempty"` // systems to run the command on Tags []string `json:"tags,omitempty"` // tags to run the command on (tags and systems are mutually exclusive) LaunchType string `json:"launchType"` // manual/add-delete-user/repeated/scheduled ListensTo string `json:"listensTo"` // AddUser/DeleteUser (when launchType is add-delete-user) Schedule string `json:"schedule,omitempty"` // immediate/agentEvent (launchType=add-delete-user)/a crontab(5) time entry as in "0 0 2 * * 6" ScheduledRunDate string `json:"scheduledRunDate"` // when LaunchType='scheduled', set to the date on which to start the command ScheduledRunTime string `json:"scheduledRunTime"` // when LaunchType='scheduled', set to the time at which to start the command Trigger string `json:"trigger,omitempty"` // generate trigger (No longer supported) Timeout string `json:"timeout"` // Command time out in seconds, after which it will be killed Organization string `json:"organization,omitempty"` // organization ID for this command (auto-populated) Sudo bool `json:"sudo"` // Indicates whether the command should be run with sudo Shell string `json:"shell"` // Shell needed for Windows only, with which to execute the command (powershell/cmd) Skip int `json:"skip"` // Objects to skip on /search POST Limit int `json:"limit"` // Max objects to return on /search POST }
func FindCommandById ¶
type JCCommandResult ¶
type JCCommandResult struct { Id string `json:"_id,omitempty"` // unique database ID Name string `json:"name"` // a title for display in the UI Command string `json:"command"` // the actual command string to execute RequestTime string `json:"requestTime,omitempty"` // The time the command started ResponseTime string `json:"responseTime,omitempty"` // The time the command exited Organization string `json:"organization,omitempty"` // organization ID for this command (auto-populated) Sudo bool `json:"sudo"` // Indicates whether the command should be run with sudo System string `json:"system,omitempty"` // The hostname of the system from which this result came WorkflowId string `json:"workflowId,omitempty"` // The ID of the workflow of which this command was a part WorkflowInstanceId string `json:"workflowInstanceId,omitempty"` // The instance ID of the workflow of which this command was a part Response JCResponse `json:"response,omitempty"` // Response data, including command output, and exit code Files []string `json:"files,omitempty"` // Names of files uploaded for this command to use during execution }
func FindCommandResultById ¶
func FindCommandResultById(commandResults []JCCommandResult, id string) (result *JCCommandResult, index int)
func (JCCommandResult) ToString ¶
func (e JCCommandResult) ToString() string
type JCCommandResultResults ¶
type JCCommandResultResults struct {
Results []JCCommandResult `json:"results"`
}
type JCCommandResults ¶
type JCCommandResults struct {
Results []JCCommand `json:"results"`
}
type JCIDSource ¶
type JCIDSource struct { Id string `json:"_id,omitempty"` Name string `json:"name"` Organization string `json:"organization,omitempty"` Type string `json:type` Version string `json:version` IpAddress string `json:ipAddress` LastUpdateTime string `json:lastUpdateTime,omitempty` DN string `json:dn` Active bool `json:active,omitempty` }
func (JCIDSource) ToString ¶
func (e JCIDSource) ToString() string
type JCIDSourceResults ¶
type JCIDSourceResults struct {
Results []JCIDSource `json:"results"`
}
type JCNetworkInterface ¶
type JCRadiusServer ¶
type JCRadiusServer struct { Id string `json:"_id,omitempty"` Name string `json:"name,omitempty"` NetworkSourceIP string `json:"networkSourceIp,omitempty"` TagList []string `json:"tags,omitempty"` }
func FindRadiusServerById ¶
func FindRadiusServerById(radiusServers []JCRadiusServer, id string) (radiusServer *JCRadiusServer)
func (JCRadiusServer) ToString ¶
func (e JCRadiusServer) ToString() string
type JCRadiusServerResults ¶
type JCRadiusServerResults struct {
Results []JCRadiusServer `json:"results"`
}
type JCResponse ¶
type JCRestAuth ¶
type JCRestAuth struct { Username string `json:"username"` Password string `json:"password"` Tag string `json:"tag"` }
func (JCRestAuth) ToString ¶
func (e JCRestAuth) ToString() string
type JCSSHDParam ¶
type JCSystem ¶
type JCSystem struct { Os string `json:"os,omitempty"` TemplateName string `json:"templateName,omitempty"` AllowSshRootLogin bool `json:"allowSshRootLogin"` Id string `json:"_id"` LastContact string `json:"lastContact,omitempty"` RemoteIP string `json:"remoteIP,omitempty"` Active bool `json:"active,omitempty"` SshRootEnabled bool `json:"sshRootEnabled"` AmazonInstanceID string `json:"amazonInstanceID,omitempty"` SshPassEnabled bool `json:"sshPassEnabled,omitempty"` Version string `json:"version,omitempty"` AgentVersion string `json:"agentVersion,omitempty"` AllowPublicKeyAuth bool `json:"allowPublicKeyAuthentication"` Organization string `json:"organization,omitempty"` Created string `json:"created,omitempty"` Arch string `json:"arch,omitempty"` SystemTimezone float64 `json:"systemTimeZone,omitempty"` AllowSshPasswordAuthentication bool `json:"allowSshPasswordAuthentication"` DisplayName string `json:"displayName"` ModifySSHDConfig bool `json:"modifySSHDConfig"` AllowMultiFactorAuthentication bool `json:"allowMultiFactorAuthentication"` Hostname string `json:"hostname,omitempty"` ConnectionHistoryList []string `json:"connectionHistory,omitempty"` SshdParams []JCSSHDParam `json:"sshdParams,omitempty"` NetworkInterfaces []JCNetworkInterface `json:"networkInterfaces, omitempty"` // Derived by JCAPI TagList []string `json:"tags,omitempty"` Tags []JCTag }
func (*JCSystem) AddJCTagsToSystem ¶
Add all the tags of which the system is a part to the JCSystem object
func (JCSystem) SystemHasTag ¶
type JCSystemResults ¶
type JCSystemResults struct {
Results []JCSystem `json:"results"`
}
type JCTag ¶
type JCTag struct { Id string `json:"_id,omitempty"` Name string `json:"name"` GroupName string `json:"groupname"` Systems []string `json:"systems"` SystemUsers []string `json:"systemusers"` RegularExpressions []string `json:"regularExpressions"` ExpirationTime string `json:"expirationTime"` Expired bool `json:"expired"` Selected bool `json:"selected"` // // For identification as an external user directory source // ExternallyManaged bool `json:"externallyManaged"` ExternalDN string `json:"externalDN,omitempty"` ExternalSourceType string `json:"externalSourceType,omitempty"` ApplyToJumpCloud bool }
type JCTagResults ¶
type JCTagResults struct {
Results []JCTag `json:"results"`
}
type JCUser ¶
type JCUser struct { Id string `json:"_id,omitempty"` UserName string `json:"username,omitempty"` FirstName string `json:"firstname,omitempty"` LastName string `json:"lastname,omitempty"` Email string `json:"email"` Password string `json:"password,omitempty"` PasswordDate string `json:"password_date,omitempty"` Activated bool `json:"activated"` ActivationKey string `json:"activation_key"` ExpiredWarned bool `json:"expired_warned"` PasswordExpired bool `json:"password_expired"` PasswordExpirationDate time.Time `json:"password_expiration_date,omitempty"` PendingProvisioning bool `json:"pendingProvisioning,omitempty"` Sudo bool `json:"sudo"` Uid string `json:"unix_uid"` Gid string `json:"unix_guid"` EnableManagedUid bool `json:"enable_managed_uid"` EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor"` TotpEnabled bool `json:"totp_enabled"` Attributes []JCUserAttribute `json:"attributes,omitempty"` TagIds []string `json:"tags,omitempty"` // the list of tag IDs that this user should be put in // // For identification as an external user directory source // ExternallyManaged bool `json:"externally_managed"` ExternalDN string `json:"external_dn,omitempty"` ExternalSourceType string `json:"external_source_type,omitempty"` Tags []JCTag // the list of actual tags the user is in }
If you add a field here make sure to add corresponding logic to getJCUserFieldsFromInterface
type JCUserAttribute ¶
func (JCUserAttribute) ToString ¶
func (attribute JCUserAttribute) ToString() string
type JCUserEmailRequest ¶
type JCUserEmailRequest struct { IsSelectAll bool `json:"isSelectAll"` Models []JCUser `json:"models"` }
Special request structure for sending activation emails
type SystemUserBinding ¶
type SystemUserBinding struct { UserId string `json:"id,omitempty"` Username string `json:"username,omitempty"` Tags []string `json:"tags,omitempty"` }
this struct describes a system user binding :