2017-02-08 15:06:19 +00:00
|
|
|
package enterprise
|
|
|
|
|
|
|
|
// Cluster is a collection of data nodes and non-data nodes within a
|
|
|
|
// Plutonium cluster.
|
|
|
|
type Cluster struct {
|
|
|
|
DataNodes []DataNode `json:"data"`
|
|
|
|
MetaNodes []Node `json:"meta"`
|
|
|
|
}
|
|
|
|
|
2017-02-19 19:47:19 +00:00
|
|
|
// DataNode represents a data node in an Influx Enterprise Cluster
|
2017-02-08 15:06:19 +00:00
|
|
|
type DataNode struct {
|
|
|
|
ID uint64 `json:"id"` // Meta store ID.
|
|
|
|
TCPAddr string `json:"tcpAddr"` // RPC addr, e.g., host:8088.
|
|
|
|
HTTPAddr string `json:"httpAddr"` // Client addr, e.g., host:8086.
|
|
|
|
HTTPScheme string `json:"httpScheme"` // "http" or "https" for HTTP addr.
|
|
|
|
Status string `json:"status,omitempty"` // The cluster status of the node.
|
|
|
|
}
|
|
|
|
|
2017-02-19 19:47:19 +00:00
|
|
|
// Node represent any meta or data node in an Influx Enterprise cluster
|
2017-02-08 15:06:19 +00:00
|
|
|
type Node struct {
|
|
|
|
ID uint64 `json:"id"`
|
|
|
|
Addr string `json:"addr"`
|
|
|
|
HTTPScheme string `json:"httpScheme"`
|
|
|
|
TCPAddr string `json:"tcpAddr"`
|
|
|
|
}
|
2017-02-17 16:12:45 +00:00
|
|
|
|
|
|
|
// Permissions maps resources to a set of permissions.
|
2017-02-17 22:03:49 +00:00
|
|
|
// Specifically, it maps a database to a set of permissions
|
2017-02-17 16:12:45 +00:00
|
|
|
type Permissions map[string][]string
|
|
|
|
|
|
|
|
// User represents an enterprise user.
|
|
|
|
type User struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Password string `json:"password,omitempty"`
|
|
|
|
Permissions Permissions `json:"permissions,omitempty"`
|
|
|
|
}
|
|
|
|
|
2017-02-19 19:47:19 +00:00
|
|
|
// Users represents a set of enterprise users.
|
2017-02-17 16:12:45 +00:00
|
|
|
type Users struct {
|
|
|
|
Users []User `json:"users,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserAction represents and action to be taken with a user.
|
|
|
|
type UserAction struct {
|
|
|
|
Action string `json:"action"`
|
|
|
|
User *User `json:"user"`
|
|
|
|
}
|
|
|
|
|
2017-02-19 19:47:19 +00:00
|
|
|
// Role is a restricted set of permissions assigned to a set of users.
|
2017-02-17 16:12:45 +00:00
|
|
|
type Role struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
NewName string `json:"newName,omitempty"`
|
|
|
|
Permissions Permissions `json:"permissions,omitempty"`
|
|
|
|
Users []string `json:"users,omitempty"`
|
|
|
|
}
|
|
|
|
|
2017-02-19 19:47:19 +00:00
|
|
|
// Roles is a set of roles
|
2017-02-17 16:12:45 +00:00
|
|
|
type Roles struct {
|
|
|
|
Roles []Role `json:"roles,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// RoleAction represents an action to be taken with a role.
|
|
|
|
type RoleAction struct {
|
|
|
|
Action string `json:"action"`
|
|
|
|
Role *Role `json:"role"`
|
|
|
|
}
|
|
|
|
|
2017-02-19 19:47:19 +00:00
|
|
|
// Error is JSON error message return by Influx Enterprise's meta API.
|
2017-02-17 16:12:45 +00:00
|
|
|
type Error struct {
|
|
|
|
Error string `json:"error"`
|
|
|
|
}
|