/
resources.go
53 lines (47 loc) · 1.21 KB
/
resources.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package resources
import (
"github.com/canonical/microcluster/internal/rest/client"
"github.com/canonical/microcluster/rest"
)
// Resources represents all the resources served over the same path.
type Resources struct {
Path client.EndpointType
Endpoints []rest.Endpoint
}
// UnixEndpoints are the endpoints available over the unix socket.
var UnixEndpoints = &Resources{
Path: client.ControlEndpoint,
Endpoints: []rest.Endpoint{
controlCmd,
shutdownCmd,
},
}
// PublicEndpoints are the /cluster/1.0 API endpoints available without authentication.
var PublicEndpoints = &Resources{
Path: client.PublicEndpoint,
Endpoints: []rest.Endpoint{
api10Cmd,
clusterCmd,
clusterMemberCmd,
tokensCmd,
readyCmd,
},
}
// InternalEndpoints are the /cluster/internal API endpoints available at the listen address.
var InternalEndpoints = &Resources{
Path: client.InternalEndpoint,
Endpoints: []rest.Endpoint{
databaseCmd,
clusterCertificatesCmd,
sqlCmd,
tokenCmd,
heartbeatCmd,
trustCmd,
trustEntryCmd,
},
}
// ExtendedEndpoints holds all the endpoints added by external usage of MicroCluster.
var ExtendedEndpoints = &Resources{
Path: client.ExtendedEndpoint,
Endpoints: []rest.Endpoint{},
}