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.
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.
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.
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.
Some of the code below came from https://github.com/digitalocean/ceph_exporter which has the same license.
Index ¶
- Constants
- func AppendAdminConnectionArgs(args []string, configDir, clusterName string) []string
- func AuthDelete(context *clusterd.Context, clusterName, name string) error
- func AuthGetKey(context *clusterd.Context, clusterName, name string) (string, error)
- func AuthGetOrCreateKey(context *clusterd.Context, clusterName, name string, caps []string) (string, error)
- func CreateDefaultCrushMap(context *clusterd.Context, clusterName string) (string, error)
- func CreateErasureCodeProfile(context *clusterd.Context, clusterName string, ...) error
- func CreateFilesystem(context *clusterd.Context, clusterName string, ...) error
- func CreatePool(context *clusterd.Context, clusterName string, newPool CephStoragePoolDetails) (string, error)
- func DeleteImage(context *clusterd.Context, clusterName, name, poolName string) error
- func ExecuteCephCommand(context *clusterd.Context, clusterName string, args []string) ([]byte, error)
- func ExecuteCephCommandPlain(context *clusterd.Context, clusterName string, args []string) ([]byte, error)
- func ExecuteRBDCommand(context *clusterd.Context, clusterName string, args []string) ([]byte, error)
- func ExecuteRBDCommandNoFormat(context *clusterd.Context, clusterName string, args []string) ([]byte, error)
- func FailMDS(context *clusterd.Context, clusterName string, gid int) error
- func FormatLocation(location string) ([]string, error)
- func GetCrushMap(context *clusterd.Context, clusterName string) (string, error)
- func HealthToModelHealthStatus(cephHealth string) model.HealthStatus
- func ListErasureCodeProfiles(context *clusterd.Context, clusterName string) ([]string, error)
- func MarkFilesystemAsDown(context *clusterd.Context, clusterName string, fsName string) error
- func RemoveFilesystem(context *clusterd.Context, clusterName string, fsName string) error
- func SetCrushMap(context *clusterd.Context, clusterName, compiledMap string) (string, error)
- func SetCrushTunables(context *clusterd.Context, clusterName, profile string) (string, error)
- func SetPoolProperty(context *clusterd.Context, clusterName, name, propName string, propVal string) error
- func StatusPlain(context *clusterd.Context, clusterName string) ([]byte, error)
- type CephBlockImage
- type CephErasureCodeProfile
- type CephFilesystem
- type CephFilesystemDetails
- type CephStatus
- type CephStoragePoolDetails
- type CephStoragePoolStats
- type CephStoragePoolSummary
- type CephUsage
- type CheckMessage
- type HealthStatus
- type MDSInfo
- type MDSMap
- type MgrMap
- type MgrStandby
- type MonMap
- type MonMapEntry
- type MonStats
- type MonStatusRequest
- type MonStatusResponse
- type MonTimeSkewStatus
- type MonTimeStatus
- type OSDDump
- type OSDPerfStats
- type OSDUsage
- type OsdMap
- type PgMap
- type PgStateEntry
Constants ¶
const ( AdminUsername = "client.admin" CephTool = "ceph" RBDTool = "rbd" CrushTool = "crushtool" )
const ( // CephHealthOK denotes the status of ceph cluster when healthy. CephHealthOK = "HEALTH_OK" // CephHealthWarn denotes the status of ceph cluster when unhealthy but recovering. CephHealthWarn = "HEALTH_WARN" // CephHealthErr denotes the status of ceph cluster when unhealthy but usually needs // manual intervention. CephHealthErr = "HEALTH_ERR" )
const (
ImageMinSize = uint64(1048576) // 1 MB
)
Variables ¶
This section is empty.
Functions ¶
func AuthGetKey ¶
func AuthGetOrCreateKey ¶
func CreateDefaultCrushMap ¶
func CreateFilesystem ¶
func CreatePool ¶
func DeleteImage ¶
func ExecuteCephCommand ¶
func ExecuteCephCommandPlain ¶
func ExecuteRBDCommand ¶
func FormatLocation ¶
func HealthToModelHealthStatus ¶
func HealthToModelHealthStatus(cephHealth string) model.HealthStatus
func ListErasureCodeProfiles ¶
func MarkFilesystemAsDown ¶
func RemoveFilesystem ¶
func SetCrushMap ¶
func SetCrushTunables ¶
func SetPoolProperty ¶
Types ¶
type CephBlockImage ¶
type CephBlockImage struct { Name string `json:"image"` Size uint64 `json:"size"` Format int `json:"format"` }
func CreateImage ¶
func ListImages ¶
func ListImages(context *clusterd.Context, clusterName, poolName string) ([]CephBlockImage, error)
type CephErasureCodeProfile ¶
type CephErasureCodeProfile struct { DataChunkCount uint `json:"k,string"` CodingChunkCount uint `json:"m,string"` Plugin string `json:"plugin"` Technique string `json:"technique"` }
func GetErasureCodeProfileDetails ¶
func GetErasureCodeProfileDetails(context *clusterd.Context, clusterName, name string) (CephErasureCodeProfile, error)
type CephFilesystem ¶
type CephFilesystem struct { Name string `json:"name"` MetadataPool string `json:"metadata_pool"` MetadataPoolID int `json:"metadata_pool_id"` DataPools []string `json:"data_pools"` DataPoolIDs []int `json:"data_pool_ids"` }
func ListFilesystems ¶
func ListFilesystems(context *clusterd.Context, clusterName string) ([]CephFilesystem, error)
type CephFilesystemDetails ¶
func GetFilesystem ¶
type CephStatus ¶
type CephStatus struct { Health HealthStatus `json:"health"` FSID string `json:"fsid"` ElectionEpoch int `json:"election_epoch"` Quorum []int `json:"quorum"` QuorumNames []string `json:"quorum_names"` MonMap MonMap `json:"monmap"` OsdMap struct { OsdMap OsdMap `json:"osdmap"` } `json:"osdmap"` PgMap PgMap `json:"pgmap"` MgrMap MgrMap `json:"mgrmap"` }
type CephStoragePoolDetails ¶
type CephStoragePoolDetails struct { Name string `json:"pool"` Number int `json:"pool_id"` Size uint `json:"size"` ErasureCodeProfile string `json:"erasure_code_profile"` }
func GetPoolDetails ¶
func GetPoolDetails(context *clusterd.Context, clusterName, name string) (CephStoragePoolDetails, error)
type CephStoragePoolStats ¶
type CephStoragePoolStats struct { Pools []struct { Name string `json:"name"` ID int `json:"id"` Stats struct { BytesUsed float64 `json:"bytes_used"` RawBytesUsed float64 `json:"raw_bytes_used"` MaxAvail float64 `json:"max_avail"` Objects float64 `json:"objects"` DirtyObjects float64 `json:"dirty"` ReadIO float64 `json:"rd"` ReadBytes float64 `json:"rd_bytes"` WriteIO float64 `json:"wr"` WriteBytes float64 `json:"wr_bytes"` } `json:"stats"` } `json:"pools"` }
func GetPoolStats ¶
func GetPoolStats(context *clusterd.Context, clusterName string) (*CephStoragePoolStats, error)
type CephStoragePoolSummary ¶
func ListPoolSummaries ¶
func ListPoolSummaries(context *clusterd.Context, clusterName string) ([]CephStoragePoolSummary, error)
type CephUsage ¶
type CheckMessage ¶
type HealthStatus ¶
type HealthStatus struct { Status string `json:"status"` Checks map[string]CheckMessage `json:"checks"` }
type MDSMap ¶
type MDSMap struct { FilesystemName string `json:"fs_name"` Enabled bool `json:"enabled"` Root int `json:"root"` TableServer int `json:"tableserver"` MaxMDS int `json:"max_mds"` In []int `json:"in"` Up map[string]int `json:"up"` Failed []int `json:"failed"` Damaged []int `json:"damaged"` Stopped []int `json:"stopped"` Info map[string]MDSInfo `json:"info"` }
type MgrStandby ¶
type MonMap ¶
type MonMap struct { Epoch int `json:"epoch"` FSID string `json:"fsid"` CreatedTime string `json:"created"` ModifiedTime string `json:"modified"` Mons []MonMapEntry `json:"mons"` }
type MonMapEntry ¶
type MonMapEntry struct { Name string `json:"name"` Rank int `json:"rank"` Address string `json:"addr"` }
represents an entry in the monitor map
type MonStats ¶
type MonStats struct { Health struct { Status string `json:"status"` Checks map[string]CheckMessage `json:"checks"` } `json:"health"` Quorum []int `json:"quorum"` }
MonStats is a subset of fields on the response from the mon command "status". These fields are focused on monitor stats.
type MonStatusRequest ¶
type MonStatusRequest struct { Prefix string `json:"prefix"` Format string `json:"format"` ID int `json:"id"` Weight float32 `json:"weight"` Pool string `json:"pool"` Var string `json:"var"` Args []string `json:"args"` }
request to simplify deserialization of a test request
type MonStatusResponse ¶
type MonStatusResponse struct { Quorum []int `json:"quorum"` MonMap struct { Mons []MonMapEntry `json:"mons"` } `json:"monmap"` }
represents the response from a mon_status mon_command (subset of all available fields, only marshal ones we care about)
func GetMonStatus ¶
func GetMonStatus(context *clusterd.Context, clusterName string, debug bool) (MonStatusResponse, error)
calls mon_status mon_command
type MonTimeSkewStatus ¶
type MonTimeStatus ¶
type MonTimeStatus struct { Skew map[string]MonTimeSkewStatus `json:"time_skew_status"` Checks struct { Epoch int `json:"epoch"` Round int `json:"round"` RoundStatus string `json:"round_status"` } `json:"timechecks"` }
func GetMonTimeStatus ¶
func GetMonTimeStatus(context *clusterd.Context, clusterName string) (*MonTimeStatus, error)
type OSDDump ¶
type OSDPerfStats ¶
type OSDPerfStats struct { PerfInfo []struct { ID json.Number `json:"id"` Stats struct { CommitLatency json.Number `json:"commit_latency_ms"` ApplyLatency json.Number `json:"apply_latency_ms"` } `json:"perf_stats"` } `json:"osd_perf_infos"` }
func GetOSDPerfStats ¶
func GetOSDPerfStats(context *clusterd.Context, clusterName string) (*OSDPerfStats, error)
type OSDUsage ¶
type OSDUsage struct { OSDNodes []struct { Name string `json:"name"` CrushWeight json.Number `json:"crush_weight"` Depth json.Number `json:"depth"` Reweight json.Number `json:"reweight"` KB json.Number `json:"kb"` UsedKB json.Number `json:"kb_used"` AvailKB json.Number `json:"kb_avail"` Utilization json.Number `json:"utilization"` Variance json.Number `json:"var"` Pgs json.Number `json:"pgs"` } `json:"nodes"` Summary struct { TotalKB json.Number `json:"total_kb"` TotalUsedKB json.Number `json:"total_kb_used"` TotalAvailKB json.Number `json:"total_kb_avail"` AverageUtil json.Number `json:"average_utilization"` } `json:"summary"` }