Documentation
¶
Index ¶
- Constants
- type ASNSource
- type ASNSyncSummary
- type Agent
- type AgentEnrollment
- type AgentEnrollmentConfig
- type ApproveAgentEnrollmentRequest
- type AutomationRun
- type BlacklistEntry
- type BlacklistRecheckResult
- type BlacklistRecheckSettings
- type ClaimAgentEnrollmentRequest
- type ClaimAgentEnrollmentResponse
- type ColoLocation
- type ColoSyncSummary
- type CreateASNSourceRequest
- type CreateAgentEnrollment
- type CreateDeviceEnrollmentRequest
- type CreateDeviceEnrollmentResponse
- type CreatePreauthorizedEnrollmentRequest
- type CreatePreauthorizedEnrollmentResponse
- type CreateScanJobRequest
- type CreateUserRequest
- type LoginRequest
- type Overview
- type Prefix
- type ProbeResult
- type ResetUserPasswordRequest
- type ResultBatch
- type ResultColoFacet
- type ResultFilter
- type ResultJobFacet
- type ResultPage
- type ResultStatusCounts
- type ScanJob
- type ScanResult
- type ScanSchedule
- type ScanTask
- type SourceStatus
- type SourceSyncSchedule
- type StartAutomationRunRequest
- type TaskBatch
- type TaskClaimRequest
- type UpdateASNSourceRequest
- type UpdateBlacklistRecheckSettingsRequest
- type UpdateSourceSyncScheduleRequest
- type UpdateUserRequest
- type UpsertScanScheduleRequest
- type User
- type UserCredential
Constants ¶
View Source
const ( AgentEnrollmentModeDevice = "device" AgentEnrollmentPending = "pending" AgentEnrollmentApproved = "approved" AgentEnrollmentClaimed = "claimed" AgentEnrollmentRejected = "rejected" AgentEnrollmentRevoked = "revoked" AgentEnrollmentExpired = "expired" )
View Source
const ( RoleAdmin = "admin" RoleViewer = "viewer" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASNSource ¶
type ASNSource struct {
ASN int64 `json:"asn"`
Name string `json:"name"`
Organization string `json:"organization"`
Enabled bool `json:"enabled"`
Managed bool `json:"managed"`
Status string `json:"status"`
PrefixCount int `json:"prefix_count"`
IPv4Count int `json:"ipv4_count"`
IPv6Count int `json:"ipv6_count"`
LastSyncedAt *time.Time `json:"last_synced_at,omitempty"`
LastError string `json:"last_error,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
ASNSource describes one BGP origin included in the Cloudflare address pool.
type ASNSyncSummary ¶
type Agent ¶
type Agent struct {
ID string `json:"id"`
Name string `json:"name"`
Region string `json:"region"`
Continent string `json:"continent"`
Concurrency int `json:"concurrency"`
Status string `json:"status"`
OS string `json:"os"`
Architecture string `json:"architecture"`
Version string `json:"version"`
LastSeenAt time.Time `json:"last_seen_at"`
CreatedAt time.Time `json:"created_at"`
}
type AgentEnrollment ¶
type AgentEnrollment struct {
ID string `json:"id"`
Mode string `json:"mode"`
Status string `json:"status"`
RequestedName string `json:"requested_name"`
OS string `json:"os"`
Architecture string `json:"architecture"`
Version string `json:"version"`
RequestedConcurrency int `json:"requested_concurrency"`
Name string `json:"name,omitempty"`
Region string `json:"region,omitempty"`
Continent string `json:"continent,omitempty"`
Concurrency int `json:"concurrency,omitempty"`
AgentID string `json:"agent_id,omitempty"`
ExpiresAt time.Time `json:"expires_at"`
ApprovedAt *time.Time `json:"approved_at,omitempty"`
ClaimedAt *time.Time `json:"claimed_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type AgentEnrollmentConfig ¶
type AutomationRun ¶
type AutomationRun struct {
ID string `json:"id"`
AutomationType string `json:"automation_type"`
AutomationKey string `json:"automation_key"`
Name string `json:"name"`
Trigger string `json:"trigger"`
Status string `json:"status"`
ConfigSnapshot json.RawMessage `json:"config_snapshot"`
Summary json.RawMessage `json:"summary"`
Error string `json:"error,omitempty"`
StartedAt time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
type BlacklistEntry ¶
type BlacklistEntry struct {
AgentID string `json:"agent_id"`
AgentName string `json:"agent_name"`
Region string `json:"region"`
Continent string `json:"continent"`
TargetIP string `json:"target_ip"`
Reason string `json:"reason"`
FailureCount int `json:"failure_count"`
BlockedAt time.Time `json:"blocked_at"`
RetryAfter time.Time `json:"retry_after"`
UpdatedAt time.Time `json:"updated_at"`
}
type BlacklistRecheckResult ¶
type BlacklistRecheckSettings ¶
type BlacklistRecheckSettings struct {
Enabled bool `json:"enabled"`
CronExpression string `json:"cron_expression"`
Timezone string `json:"timezone"`
DueOnly bool `json:"due_only"`
Fraction float64 `json:"fraction"`
MaxTargets int `json:"max_targets"`
SkipIfRunning bool `json:"skip_if_running"`
Attempts int `json:"attempts"`
TimeoutMS int `json:"timeout_ms"`
MaxLatencyMS float64 `json:"max_latency_ms"`
MaxPacketLoss float64 `json:"max_packet_loss"`
RetryMinutes int `json:"retry_minutes"`
NextRunAt time.Time `json:"next_run_at"`
LastRunAt *time.Time `json:"last_run_at,omitempty"`
LastError string `json:"last_error,omitempty"`
EligibleTargets int `json:"eligible_targets"`
UpdatedAt time.Time `json:"updated_at"`
}
BlacklistRecheckSettings controls the only automatic blacklist recovery flow.
type ClaimAgentEnrollmentRequest ¶
type ClaimAgentEnrollmentRequest struct {
PairingToken string `json:"pairing_token"`
CredentialID string `json:"credential_id"`
CredentialSecret string `json:"credential_secret"`
OS string `json:"os,omitempty"`
Architecture string `json:"architecture,omitempty"`
Version string `json:"version,omitempty"`
}
type ColoLocation ¶
type ColoLocation struct {
Code string `json:"code"`
City string `json:"city"`
Country string `json:"country"`
Continent string `json:"continent"`
Status string `json:"status"`
UpdatedAt time.Time `json:"updated_at"`
}
ColoLocation maps a Cloudflare colo code to the geographic metadata published on Cloudflare Status.
type ColoSyncSummary ¶
type CreateASNSourceRequest ¶
type CreateAgentEnrollment ¶
type CreatePreauthorizedEnrollmentRequest ¶
type CreatePreauthorizedEnrollmentRequest struct {
}
type CreatePreauthorizedEnrollmentResponse ¶
type CreatePreauthorizedEnrollmentResponse struct {
}
type CreateScanJobRequest ¶
type CreateScanJobRequest struct {
Kind string `json:"-"`
Name string `json:"name"`
AgentIDs []string `json:"agent_ids"`
SamplingMode string `json:"sampling_mode"`
TargetCount int `json:"target_count"`
Scheme string `json:"scheme"`
Hostname string `json:"hostname"`
Path string `json:"path"`
Port int `json:"port"`
Attempts int `json:"attempts"`
TimeoutMS int `json:"timeout_ms"`
MaxLatencyMS float64 `json:"max_latency_ms"`
MaxPacketLoss float64 `json:"max_packet_loss"`
BlacklistMinutes int `json:"blacklist_minutes"`
IncludeIPv6 bool `json:"include_ipv6"`
IncludeBlocked bool `json:"include_blocked"`
}
type CreateUserRequest ¶
type LoginRequest ¶
type Overview ¶
type Overview struct {
AgentsTotal int64 `json:"agents_total"`
AgentsOnline int64 `json:"agents_online"`
PrefixesTotal int64 `json:"prefixes_total"`
IPsTotal int64 `json:"ips_total"`
IPsAvailable int64 `json:"ips_available"`
IPsBlacklisted int64 `json:"ips_blacklisted"`
RunningJobs int64 `json:"running_jobs"`
CompletedJobs int64 `json:"completed_jobs"`
AverageLatencyMS float64 `json:"average_latency_ms"`
ResultsLast24Hour int64 `json:"results_last_24h"`
}
type ProbeResult ¶
type ProbeResult struct {
TaskID int64 `json:"task_id"`
TargetIP string `json:"target_ip"`
Available bool `json:"available"`
LatencyMS float64 `json:"latency_ms"`
PacketLoss float64 `json:"packet_loss"`
TCPConnectMS float64 `json:"tcp_connect_ms"`
TLSHandshakeMS float64 `json:"tls_handshake_ms"`
TTFBMS float64 `json:"ttfb_ms"`
TotalMS float64 `json:"total_ms"`
HTTPStatus int `json:"http_status"`
HTTPVersion string `json:"http_version"`
TLSVersion string `json:"tls_version"`
Colo string `json:"colo"`
CFRay string `json:"cf_ray"`
ErrorCode string `json:"error_code,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
SuccessfulTries int `json:"successful_tries"`
Attempts int `json:"attempts"`
}
type ResetUserPasswordRequest ¶
type ResetUserPasswordRequest struct {
Password string `json:"password"`
}
type ResultBatch ¶
type ResultBatch struct {
AgentID string `json:"-"`
JobID string `json:"job_id"`
Results []ProbeResult `json:"results"`
}
type ResultColoFacet ¶
type ResultColoFacet struct {
Code string `json:"code"`
City string `json:"city"`
Country string `json:"country"`
Continent string `json:"continent"`
Count int `json:"count"`
}
ResultColoFacet is a colo location that currently has matching scan results.
type ResultFilter ¶
type ResultJobFacet ¶
type ResultPage ¶
type ResultPage struct {
Items []ScanResult `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
TotalPages int `json:"total_pages"`
Counts ResultStatusCounts `json:"counts"`
}
type ResultStatusCounts ¶
type ScanJob ¶
type ScanJob struct {
ID string `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
Status string `json:"status"`
SamplingMode string `json:"sampling_mode"`
Scheme string `json:"scheme"`
Hostname string `json:"hostname"`
Path string `json:"path"`
Port int `json:"port"`
Attempts int `json:"attempts"`
TimeoutMS int `json:"timeout_ms"`
MaxLatencyMS float64 `json:"max_latency_ms"`
MaxPacketLoss float64 `json:"max_packet_loss"`
BlacklistMinutes int `json:"blacklist_minutes"`
TotalTargets int `json:"total_targets"`
CompletedTargets int `json:"completed_targets"`
SuccessTargets int `json:"success_targets"`
FailedTargets int `json:"failed_targets"`
Progress float64 `json:"progress"`
CreatedAt time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
type ScanResult ¶
type ScanResult struct {
ID int64 `json:"id"`
JobID string `json:"job_id"`
JobName string `json:"job_name"`
AgentID string `json:"agent_id"`
AgentName string `json:"agent_name"`
Region string `json:"region"`
Continent string `json:"continent"`
TargetIP string `json:"target_ip"`
Available bool `json:"available"`
LatencyMS float64 `json:"latency_ms"`
PacketLoss float64 `json:"packet_loss"`
TCPConnectMS float64 `json:"tcp_connect_ms"`
TLSHandshakeMS float64 `json:"tls_handshake_ms"`
TTFBMS float64 `json:"ttfb_ms"`
TotalMS float64 `json:"total_ms"`
HTTPStatus int `json:"http_status"`
HTTPVersion string `json:"http_version"`
TLSVersion string `json:"tls_version"`
Colo string `json:"colo"`
ColoCity string `json:"colo_city"`
ColoCountry string `json:"colo_country"`
ColoContinent string `json:"colo_continent"`
CFRay string `json:"cf_ray"`
ErrorCode string `json:"error_code,omitempty"`
ScannedAt time.Time `json:"scanned_at"`
}
type ScanSchedule ¶
type ScanSchedule struct {
ID string `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
CronExpression string `json:"cron_expression"`
Timezone string `json:"timezone"`
AgentIDs []string `json:"agent_ids"`
SamplingMode string `json:"sampling_mode"`
TargetCount int `json:"target_count"`
Scheme string `json:"scheme"`
Hostname string `json:"hostname"`
Path string `json:"path"`
Port int `json:"port"`
Attempts int `json:"attempts"`
TimeoutMS int `json:"timeout_ms"`
MaxLatencyMS float64 `json:"max_latency_ms"`
MaxPacketLoss float64 `json:"max_packet_loss"`
BlacklistMinutes int `json:"blacklist_minutes"`
IncludeIPv6 bool `json:"include_ipv6"`
IncludeBlocked bool `json:"include_blocked"`
NextRunAt time.Time `json:"next_run_at"`
LastRunAt *time.Time `json:"last_run_at,omitempty"`
LastJobID *string `json:"last_job_id,omitempty"`
LastError string `json:"last_error,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (ScanSchedule) JobRequest ¶
func (s ScanSchedule) JobRequest() CreateScanJobRequest
type SourceStatus ¶
type SourceSyncSchedule ¶
type SourceSyncSchedule struct {
Source string `json:"source"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
CronExpression string `json:"cron_expression"`
Timezone string `json:"timezone"`
RunOnStartup bool `json:"run_on_startup"`
NextRunAt time.Time `json:"next_run_at"`
LastRunAt *time.Time `json:"last_run_at,omitempty"`
LastError string `json:"last_error,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
type TaskClaimRequest ¶
type TaskClaimRequest struct {
Limit int `json:"limit"`
}
type UpdateASNSourceRequest ¶
type UpdateBlacklistRecheckSettingsRequest ¶
type UpdateBlacklistRecheckSettingsRequest struct {
Enabled bool `json:"enabled"`
CronExpression string `json:"cron_expression"`
Timezone string `json:"timezone"`
DueOnly bool `json:"due_only"`
Fraction float64 `json:"fraction"`
MaxTargets int `json:"max_targets"`
SkipIfRunning bool `json:"skip_if_running"`
Attempts int `json:"attempts"`
TimeoutMS int `json:"timeout_ms"`
MaxLatencyMS float64 `json:"max_latency_ms"`
MaxPacketLoss float64 `json:"max_packet_loss"`
RetryMinutes int `json:"retry_minutes"`
}
type UpdateUserRequest ¶
type UpsertScanScheduleRequest ¶
type UpsertScanScheduleRequest struct {
Name string `json:"name"`
Enabled bool `json:"enabled"`
CronExpression string `json:"cron_expression"`
Timezone string `json:"timezone"`
AgentIDs []string `json:"agent_ids"`
SamplingMode string `json:"sampling_mode"`
TargetCount int `json:"target_count"`
Scheme string `json:"scheme"`
Hostname string `json:"hostname"`
Path string `json:"path"`
Port int `json:"port"`
Attempts int `json:"attempts"`
TimeoutMS int `json:"timeout_ms"`
MaxLatencyMS float64 `json:"max_latency_ms"`
MaxPacketLoss float64 `json:"max_packet_loss"`
BlacklistMinutes int `json:"blacklist_minutes"`
IncludeIPv6 bool `json:"include_ipv6"`
IncludeBlocked bool `json:"include_blocked"`
}
func (*UpsertScanScheduleRequest) ApplyJobRequest ¶
func (r *UpsertScanScheduleRequest) ApplyJobRequest(job CreateScanJobRequest)
func (UpsertScanScheduleRequest) JobRequest ¶
func (r UpsertScanScheduleRequest) JobRequest() CreateScanJobRequest
type User ¶
type User struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
Role string `json:"role"`
Enabled bool `json:"enabled"`
LastLoginAt *time.Time `json:"last_login_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UserCredential ¶
Click to show internal directories.
Click to hide internal directories.