api

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Some of the code below came from https://github.com/digitalocean/ceph_exporter which has the same license.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatJsonResponse

func FormatJsonResponse(w http.ResponseWriter, object interface{})

Format a json response

func Logger

func Logger(inner http.Handler, name string) http.Handler

func Run

func Run(context *clusterd.Context, c *Config) error

func ServeRoutes

func ServeRoutes(context *clusterd.Context, c *Config)

func WatchMonConfig

func WatchMonConfig(context *clusterd.Context, c *Config)

Types

type CephExporter

type CephExporter struct {
	// contains filtered or unexported fields
}

CephExporter wraps all the ceph collectors and provides a single global exporter to extracts metrics out of. It also ensures that the collection is done in a thread-safe manner, the necessary requirement stated by prometheus. It also implements a prometheus.Collector interface in order to register it correctly.

func NewCephExporter

func NewCephExporter(h *Handler) *CephExporter

NewCephExporter creates an instance to CephExporter and returns a reference to it. We can choose to enable a collector to extract stats out of by adding it to the list of collectors.

func (*CephExporter) Collect

func (c *CephExporter) Collect(ch chan<- prometheus.Metric)

Collect sends the collected metrics from each of the collectors to prometheus. Collect could be called several times concurrently and thus its run is protected by a single mutex.

func (*CephExporter) Describe

func (c *CephExporter) Describe(ch chan<- *prometheus.Desc)

Describe sends all the descriptors of the collectors included to the provided channel.

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(context *clusterd.Context, port int, clusterInfo *mon.ClusterInfo, namespace, rookImage string, hostNetwork bool) *Config

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) CreateFileSystem

func (h *Handler) CreateFileSystem(w http.ResponseWriter, r *http.Request)

Creates a new file system in this cluster. POST /filesystem

func (*Handler) CreateImage

func (h *Handler) CreateImage(w http.ResponseWriter, r *http.Request)

Creates a new image in this cluster. POST /image

func (*Handler) CreateObjectStore

func (h *Handler) CreateObjectStore(w http.ResponseWriter, r *http.Request)

CreateObjectStore creates a new object store in this cluster. POST /objectstore

func (*Handler) CreatePool

func (h *Handler) CreatePool(w http.ResponseWriter, r *http.Request)

Creates a storage pool as specified by the request body. POST /pool

func (*Handler) CreateUser

func (h *Handler) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser will create a new user from the passed info in the object store in this cluster. POST /objectstore/{name}/users

func (*Handler) DeleteBucket

func (h *Handler) DeleteBucket(w http.ResponseWriter, r *http.Request)

DeleteBucket deletes the bucket in the object store in this cluster. DELETE /objectstore/{name}/buckets/{BUCKET_NAME}

func (*Handler) DeleteImage

func (h *Handler) DeleteImage(w http.ResponseWriter, r *http.Request)

Deletes a block image from this cluster. DELETE /image?name=<imageName>&pool=<imagePool>

func (*Handler) DeletePool

func (h *Handler) DeletePool(w http.ResponseWriter, r *http.Request)

Creates a storage pool as specified by the request body. DELETE /pool/{name}

func (*Handler) DeleteUser

func (h *Handler) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser deletes the passed user for the object store in this cluster. DELETE /objectstore/{name}/users/{USER_ID}

func (*Handler) GetBucket

func (h *Handler) GetBucket(w http.ResponseWriter, r *http.Request)

GetBucket gets the bucket from the object store in this cluster. GET /objectstore/{name}/buckets/{BUCKET_NAME}

func (*Handler) GetClientAccessInfo

func (h *Handler) GetClientAccessInfo(w http.ResponseWriter, r *http.Request)

Gets the information needed for a client to access the cluster. GET /client

func (*Handler) GetFileSystems

func (h *Handler) GetFileSystems(w http.ResponseWriter, r *http.Request)

Gets a listing of file systems in this cluster. GET /filesystem

func (*Handler) GetImages

func (h *Handler) GetImages(w http.ResponseWriter, r *http.Request)

Gets the images that have been created in this cluster. GET /image

func (*Handler) GetNodes

func (h *Handler) GetNodes(w http.ResponseWriter, r *http.Request)

Gets the nodes that are part of this cluster. GET /node

func (*Handler) GetObjectStoreConnectionInfo

func (h *Handler) GetObjectStoreConnectionInfo(w http.ResponseWriter, r *http.Request)

GetObjectStoreConnectionInfo gets connection information to the object store in this cluster. GET /objectstore/{name}/connectioninfo

func (*Handler) GetObjectStores

func (h *Handler) GetObjectStores(w http.ResponseWriter, r *http.Request)

GetObjectStores gets the object stores in this cluster. GET /objectstore

func (*Handler) GetPools

func (h *Handler) GetPools(w http.ResponseWriter, r *http.Request)

Gets the storage pools that have been created in this cluster. GET /pool

func (*Handler) GetRoutes

func (h *Handler) GetRoutes() []Route

func (*Handler) GetStatusDetails

func (h *Handler) GetStatusDetails(w http.ResponseWriter, r *http.Request)

Gets the status details of this cluster. GET /status

func (*Handler) GetUser

func (h *Handler) GetUser(w http.ResponseWriter, r *http.Request)

GetUser gets the passed users info from the object store in this cluster. GET /objectstore/{name}/users/{id}

func (*Handler) ListBuckets

func (h *Handler) ListBuckets(w http.ResponseWriter, r *http.Request)

Listbuckets lists the buckets in the object store in this cluster. GET /objectstore/{name}/buckets

func (*Handler) ListUsers

func (h *Handler) ListUsers(w http.ResponseWriter, r *http.Request)

ListUsers lists the users of the object store in this cluster. GET /objectstore/{name}/users

func (*Handler) RegisterMetrics

func (h *Handler) RegisterMetrics(retryMs int) error

RegisterMetrics registers all collected metrics by this API server. Note this should be called in a goroutine because it will retry upon failure and block until successful.

func (*Handler) RemoveFileSystem

func (h *Handler) RemoveFileSystem(w http.ResponseWriter, r *http.Request)

Removes an existing filesystem from this cluster. DELETE /filesystem?name=<fsName>

func (*Handler) RemoveObjectStore

func (h *Handler) RemoveObjectStore(w http.ResponseWriter, r *http.Request)

RemoveObjectStore removes the object store from this cluster. DELETE /objectstore/{name}

func (*Handler) SetLogLevel

func (h *Handler) SetLogLevel(w http.ResponseWriter, r *http.Request)

Sets the log level for this node. POST /log

func (*Handler) Shutdown

func (h *Handler) Shutdown()

func (*Handler) UpdateUser

func (h *Handler) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser updates the passed user with the passed info for the object store in this cluster. PUT /objectstore/{name}/users/{USER_ID}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL