hhctl CLI and Terraform provider for Hammerhead
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
bf340cdab4
19 files changed
+2442
No files matched your search
+134
@@ -0,0 +1,134 @@
|
||||
package client
|
||||
|
||||
import "time"
|
||||
|
||||
type Org struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
AllowLocal bool `json:"allowLocal"`
|
||||
}
|
||||
|
||||
type Edge struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Name string `json:"name"`
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
Online bool `json:"online,omitempty"`
|
||||
TunnelAddr string `json:"tunnelAddr,omitempty"`
|
||||
Token string `json:"token,omitempty"`
|
||||
OrgIDs []string `json:"orgIds"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
type Site struct {
|
||||
ID string `json:"id"`
|
||||
OrgID string `json:"orgId"`
|
||||
Name string `json:"name"`
|
||||
Token string `json:"token,omitempty"`
|
||||
Connected []string `json:"connected"`
|
||||
LastSeen time.Time `json:"lastSeen"`
|
||||
Local bool `json:"local"`
|
||||
EdgeID string `json:"edgeId,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
TunnelIP string `json:"tunnelIp,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
type Domain struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
OrgID string `json:"orgId,omitempty"`
|
||||
Name string `json:"name"`
|
||||
EdgeID string `json:"edgeId"`
|
||||
IP string `json:"ip"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type Target struct {
|
||||
SiteID string `json:"siteId"`
|
||||
Host string `json:"host"`
|
||||
Port int `json:"port"`
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
SSO bool `json:"sso"`
|
||||
Password bool `json:"password"`
|
||||
Pin bool `json:"pin"`
|
||||
Email bool `json:"email"`
|
||||
AllowedRoles []string `json:"allowedRoles"`
|
||||
AllowedUsers []string `json:"allowedUsers"`
|
||||
AllowedMails []string `json:"allowedMails"`
|
||||
SessionHours int `json:"sessionHours"`
|
||||
}
|
||||
|
||||
type Rule struct {
|
||||
Action string `json:"action"`
|
||||
Match string `json:"match"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// Port is what the dashboard calls a port (the server's "mapping"): a public port or hostname
|
||||
// on an edge, forwarded to targets. NewPassword and NewPin are write-only: nil keeps, "" removes.
|
||||
type Port struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
OrgID string `json:"orgId,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Proto string `json:"proto"`
|
||||
EdgeID string `json:"edgeId"`
|
||||
BindIP string `json:"bindIp"`
|
||||
Port int `json:"port"`
|
||||
PortEnd int `json:"portEnd,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
Targets []Target `json:"targets"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
ProxyProtocol string `json:"proxyProtocol,omitempty"`
|
||||
RedirectTo string `json:"redirectTo,omitempty"`
|
||||
RedirectPermanent bool `json:"redirectPermanent,omitempty"`
|
||||
RedirectKeepPath bool `json:"redirectKeepPath,omitempty"`
|
||||
Auth Auth `json:"auth"`
|
||||
AuthEpoch int64 `json:"authEpoch,omitempty"`
|
||||
Rules []Rule `json:"rules"`
|
||||
RedirectHTTP bool `json:"redirectHttp"`
|
||||
BackendHTTPS bool `json:"backendHttps"`
|
||||
RewriteHost string `json:"rewriteHost"`
|
||||
HealthPath string `json:"healthPath"`
|
||||
HealthSeconds int `json:"healthSeconds"`
|
||||
|
||||
NewPassword *string `json:"newPassword,omitempty"`
|
||||
NewPin *string `json:"newPin,omitempty"`
|
||||
}
|
||||
|
||||
type Channel struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
OrgID string `json:"orgId,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Kind string `json:"kind"` // email, webhook or sandbar
|
||||
Target string `json:"target"`
|
||||
Format string `json:"format,omitempty"`
|
||||
Token string `json:"token,omitempty"`
|
||||
Policy string `json:"policy,omitempty"`
|
||||
AllowPrivate bool `json:"allowPrivate"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
type AlertRow struct {
|
||||
Key string `json:"key"`
|
||||
Kind string `json:"kind"`
|
||||
Name string `json:"name"`
|
||||
Message string `json:"message"`
|
||||
Since time.Time `json:"since"`
|
||||
Fired bool `json:"fired"`
|
||||
}
|
||||
|
||||
// Alerts is the alerts overview of an organization (or, with the server flag, of the server).
|
||||
type Alerts struct {
|
||||
Channels []Channel `json:"channels"`
|
||||
Active []AlertRow `json:"active"`
|
||||
Settings map[string]int `json:"settings"`
|
||||
}
|
||||
|
||||
type State struct {
|
||||
Edges []Edge `json:"edges"`
|
||||
Sites []Site `json:"sites"`
|
||||
Domains []Domain `json:"domains"`
|
||||
Mappings []Port `json:"mappings"`
|
||||
}
|
||||
Reference in new issue
Block a user