Documentation ¶
Overview ¶
Package account contains definitions for NS1 apikeys/teams/users/etc.
Index ¶
- type APIKey
- type Address
- type AuthTag
- type IDP
- type IPWhitelist
- type NotificationSettings
- type PermissionsAccount
- type PermissionsDHCP
- type PermissionsDNS
- type PermissionsData
- type PermissionsIPAM
- type PermissionsMap
- type PermissionsMonitoring
- type PermissionsRecord
- type PermissionsSecurity
- type SAML
- type Setting
- type SharedAuth
- type Team
- type UsageWarning
- type User
- type Warning
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct { // Read-only fields ID string `json:"id,omitempty"` Key string `json:"key,omitempty"` LastAccess int `json:"last_access,omitempty"` Name string `json:"name"` TeamIDs []string `json:"teams"` Permissions PermissionsMap `json:"permissions"` IPWhitelist []string `json:"ip_whitelist"` IPWhitelistStrict bool `json:"ip_whitelist_strict"` }
APIKey wraps an NS1 /account/apikeys resource
type Address ¶
type Address struct { Country string `json:"country,omitempty"` Street string `json:"street,omitempty"` State string `json:"state,omitempty"` City string `json:"city,omitempty"` Postal string `json:"postalcode,omitempty"` }
Address for Setting struct.
type AuthTag ¶
AuthTag wraps the tags used in "tags_allow" and "tags_deny" in DDI and IPAM permissions in DDI. Tag Names must start with prefix "auth:"
type IDP ¶
type IDP struct { UseMetadataURL *bool `json:"use_metadata_url"` MetadataURL *string `json:"metadata_url"` MetadataFile *string `json:"metadata_file"` Provider *string `json:"provider"` }
IDP wraps the IDP object in SAML.
type IPWhitelist ¶
type IPWhitelist struct { ID string `json:"id,omitempty"` Name string `json:"name"` Values []string `json:"values"` }
IPWhitelist wraps the IP whitelist.
type NotificationSettings ¶
type NotificationSettings struct {
Billing bool `json:"billing"`
}
NotificationSettings wraps a User's "notify" attribute
type PermissionsAccount ¶
type PermissionsAccount struct { ManageUsers bool `json:"manage_users"` ManagePaymentMethods bool `json:"manage_payment_methods"` ManagePlan bool `json:"manage_plan"` ManageTeams bool `json:"manage_teams"` ManageApikeys bool `json:"manage_apikeys"` ManageAccountSettings bool `json:"manage_account_settings"` ViewActivityLog bool `json:"view_activity_log"` ViewInvoices bool `json:"view_invoices"` ManageIPWhitelist bool `json:"manage_ip_whitelist"` }
PermissionsAccount wraps a User's "permissions.account" attribute
type PermissionsDHCP ¶
type PermissionsDHCP struct { ManageDHCP bool `json:"manage_dhcp"` ViewDHCP bool `json:"view_dhcp"` // The fields below are only relevant in DDI v2.5+ TagsAllow *[]AuthTag `json:"tags_allow,omitempty"` TagsDeny *[]AuthTag `json:"tags_deny,omitempty"` }
PermissionsDHCP wraps a User's "permissions.dhcp" attribute for DDI.
type PermissionsDNS ¶
type PermissionsDNS struct { ViewZones bool `json:"view_zones"` ManageZones bool `json:"manage_zones"` ZonesAllowByDefault bool `json:"zones_allow_by_default"` ZonesDeny []string `json:"zones_deny"` ZonesAllow []string `json:"zones_allow"` RecordsAllow []PermissionsRecord `json:"records_allow"` RecordsDeny []PermissionsRecord `json:"records_deny"` }
PermissionsDNS wraps a User's "permissions.dns" attribute
type PermissionsData ¶
type PermissionsData struct { PushToDatafeeds bool `json:"push_to_datafeeds"` ManageDatasources bool `json:"manage_datasources"` ManageDatafeeds bool `json:"manage_datafeeds"` }
PermissionsData wraps a User's "permissions.data" attribute
type PermissionsIPAM ¶
type PermissionsIPAM struct { ManageIPAM bool `json:"manage_ipam"` ViewIPAM bool `json:"view_ipam"` // The fields below are only relevant in DDI v2.5+ TagsAllow *[]AuthTag `json:"tags_allow,omitempty"` TagsDeny *[]AuthTag `json:"tags_deny,omitempty"` }
PermissionsIPAM wraps a User's "permissions.ipam" attribute for DDI.
type PermissionsMap ¶
type PermissionsMap struct { DNS PermissionsDNS `json:"dns"` Data PermissionsData `json:"data"` Account PermissionsAccount `json:"account"` Monitoring PermissionsMonitoring `json:"monitoring"` Security *PermissionsSecurity `json:"security,omitempty"` // DHCP and IPAM are only relevant for DDI and should not be provided in managed. DHCP *PermissionsDHCP `json:"dhcp,omitempty"` IPAM *PermissionsIPAM `json:"ipam,omitempty"` }
PermissionsMap wraps a User's "permissions" attribute
type PermissionsMonitoring ¶
type PermissionsMonitoring struct { ManageLists bool `json:"manage_lists"` ManageJobs bool `json:"manage_jobs"` ViewJobs bool `json:"view_jobs"` }
PermissionsMonitoring wraps a User's "permissions.monitoring" attribute Only relevant for the managed product.
type PermissionsRecord ¶
type PermissionsRecord struct { Domain string `json:"domain"` Subdomains bool `json:"include_subdomains"` Zone string `json:"zone"` RecordType string `json:"type"` }
PermissionsRecord wraps a User's "permissions.record" attribute
type PermissionsSecurity ¶
type PermissionsSecurity struct { ManageGlobal2FA bool `json:"manage_global_2fa"` // This field is only relevant for DDI and should not be set to true for managed. ManageActiveDirectory bool `json:"manage_active_directory,omitempty"` }
PermissionsSecurity wraps a User's "permissions.security" attribute.
type Setting ¶
type Setting struct { CustomerID int `json:"customerid,omitempty"` FirstName string `json:"firstname,omitempty"` LastName string `json:"lastname,omitempty"` Company string `json:"company,omitempty"` Phone string `json:"phone,omitempty"` Email string `json:"email,omitempty"` Address Address `json:"address,omitempty"` }
Setting represents an accounts' contact info.
type Team ¶
type Team struct { ID string `json:"id,omitempty"` Name string `json:"name"` Permissions PermissionsMap `json:"permissions"` IPWhitelist []IPWhitelist `json:"ip_whitelist"` }
Team wraps an NS1 /accounts/teams resource
type UsageWarning ¶
UsageWarning wraps an NS1 /account/usagewarnings resource
type User ¶
type User struct { // Read-only fields LastAccess float64 `json:"last_access"` Created float64 `json:"created"` Name string `json:"name"` Username string `json:"username"` Email string `json:"email"` TeamIDs []string `json:"teams"` Notify NotificationSettings `json:"notify"` Permissions PermissionsMap `json:"permissions"` IPWhitelist []string `json:"ip_whitelist"` IPWhitelistStrict bool `json:"ip_whitelist_strict"` TwoFactorAuthEnabled bool `json:"2fa_enabled"` InviteToken string `json:"invite_token,omitempty"` }
User wraps an NS1 /account/users resource
type Warning ¶
type Warning struct { Send bool `json:"send_warnings"` First int `json:"warning_1"` Second int `json:"warning_2"` }
Warning contains alerting toggles and thresholds for overage warning alert messages. First thresholds must be smaller than Second ones and all thresholds must be percentages between 0 and 100.