Skip to content

Commit

Permalink
rbd/admin: promote ImageSpec & tasks api to stable
Browse files Browse the repository at this point in the history
Promoting ImageSpec & task apis to stable so
they can be release in v0.13.0.

Signed-off-by: Rakshith R <[email protected]>
  • Loading branch information
Rakshith-R authored and mergify[bot] committed Nov 29, 2021
1 parent b5c4989 commit 7d88103
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 61 deletions.
40 changes: 10 additions & 30 deletions docs/api-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -1590,62 +1590,42 @@
{
"name": "MirrorSnashotScheduleAdmin.Status",
"comment": "Status returns the status of the snapshot (eg. when it will next take place)\nmatching the supplied level spec.\n\nSimilar To:\n rbd mirror snapshot schedule status <level_spec>\n"
}
],
"preview_api": [
},
{
"name": "NewImageSpec",
"comment": "NewImageSpec is used to construct an ImageSpec given an image name/id\nand optional namespace and pool names.\nNewImageSpec constructs an ImageSpec to identify an RBD image and thus\nrequires image name/id, whereas NewLevelSpec constructs LevelSpec to\nidentify entire pool, pool namespace or single RBD image, all of which\nrequires pool name.\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "NewImageSpec is used to construct an ImageSpec given an image name/id\nand optional namespace and pool names.\nNewImageSpec constructs an ImageSpec to identify an RBD image and thus\nrequires image name/id, whereas NewLevelSpec constructs LevelSpec to\nidentify entire pool, pool namespace or single RBD image, all of which\nrequires pool name.\n"
},
{
"name": "NewRawImageSpec",
"comment": "NewRawImageSpec returns a ImageSpec directly based on the spec string\nargument without constructing it from component values. This should only be\nused if NewImageSpec can not create the imagespec value you want to pass to\nceph.\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "NewRawImageSpec returns a ImageSpec directly based on the spec string\nargument without constructing it from component values. This should only be\nused if NewImageSpec can not create the imagespec value you want to pass to\nceph.\n"
},
{
"name": "RBDAdmin.Task",
"comment": "Task returns a TaskAdmin type for\nmanaging ceph rbd task operations.\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "Task returns a TaskAdmin type for\nmanaging ceph rbd task operations.\n"
},
{
"name": "TaskAdmin.AddFlatten",
"comment": "AddFlatten adds a background task to flatten a cloned image based on the supplied image spec.\n\nSimilar To:\n rbd task add flatten <image_spec>\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "AddFlatten adds a background task to flatten a cloned image based on the supplied image spec.\n\nSimilar To:\n rbd task add flatten <image_spec>\n"
},
{
"name": "TaskAdmin.AddRemove",
"comment": "AddRemove adds a background task to remove an image based on the supplied image spec.\n\nSimilar To:\n rbd task add remove <image_spec>\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "AddRemove adds a background task to remove an image based on the supplied image spec.\n\nSimilar To:\n rbd task add remove <image_spec>\n"
},
{
"name": "TaskAdmin.AddTrashRemove",
"comment": "AddTrashRemove adds a background task to remove an image from the trash based on the\nsupplied image id spec.\n\nSimilar To:\n rbd task add trash remove <image_id_spec>\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "AddTrashRemove adds a background task to remove an image from the trash based on the\nsupplied image id spec.\n\nSimilar To:\n rbd task add trash remove <image_id_spec>\n"
},
{
"name": "TaskAdmin.List",
"comment": "List pending or running asynchronous tasks.\n\nSimilar To:\n rbd task list\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "List pending or running asynchronous tasks.\n\nSimilar To:\n rbd task list\n"
},
{
"name": "TaskAdmin.GetTaskByID",
"comment": "GetTaskByID returns pending or running asynchronous task using id.\n\nSimilar To:\n rbd task list <task_id>\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "GetTaskByID returns pending or running asynchronous task using id.\n\nSimilar To:\n rbd task list <task_id>\n"
},
{
"name": "TaskAdmin.Cancel",
"comment": "Cancel a pending or running asynchronous task.\n\nSimilar To:\n rbd task cancel <task_id>\nPREVIEW\n",
"added_in_version": "v0.12.0",
"expected_stable_version": "v0.13.0"
"comment": "Cancel a pending or running asynchronous task.\n\nSimilar To:\n rbd task cancel <task_id>\n"
}
]
},
Expand Down
12 changes: 0 additions & 12 deletions docs/api-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ Snapshot.Set | v0.10.0 | |

### Preview APIs

Name | Added in Version | Expected Stable Version |
---- | ---------------- | ----------------------- |
NewImageSpec | v0.12.0 | v0.13.0 |
NewRawImageSpec | v0.12.0 | v0.13.0 |
RBDAdmin.Task | v0.12.0 | v0.13.0 |
TaskAdmin.AddFlatten | v0.12.0 | v0.13.0 |
TaskAdmin.AddRemove | v0.12.0 | v0.13.0 |
TaskAdmin.AddTrashRemove | v0.12.0 | v0.13.0 |
TaskAdmin.List | v0.12.0 | v0.13.0 |
TaskAdmin.GetTaskByID | v0.12.0 | v0.13.0 |
TaskAdmin.Cancel | v0.12.0 | v0.13.0 |

## Package: rgw/admin

### Preview APIs
Expand Down
7 changes: 2 additions & 5 deletions rbd/admin/imagespec.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview
//go:build !nautilus
// +build !nautilus

package admin

Expand All @@ -10,14 +10,12 @@ import (
// ImageSpec values are used to identify an RBD image wherever Ceph APIs
// require an image_spec/image_id_spec using image name/id and optional
// pool and namespace.
// PREVIEW
type ImageSpec struct {
spec string
}

// NewImageSpec is used to construct an ImageSpec given an image name/id
// and optional namespace and pool names.
// PREVIEW
//
// NewImageSpec constructs an ImageSpec to identify an RBD image and thus
// requires image name/id, whereas NewLevelSpec constructs LevelSpec to
Expand All @@ -37,7 +35,6 @@ func NewImageSpec(pool, namespace, image string) ImageSpec {

// NewRawImageSpec returns a ImageSpec directly based on the spec string
// argument without constructing it from component values.
// PREVIEW
//
// This should only be used if NewImageSpec can not create the imagespec value
// you want to pass to ceph.
Expand Down
14 changes: 2 additions & 12 deletions rbd/admin/task.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview
//go:build !nautilus
// +build !nautilus

package admin

Expand All @@ -9,19 +9,16 @@ import (
)

// TaskAdmin encapsulates management functions for ceph rbd task operations.
// PREVIEW
type TaskAdmin struct {
conn ccom.MgrCommander
}

// Task returns a TaskAdmin type for managing ceph rbd task operations.
// PREVIEW
func (ra *RBDAdmin) Task() *TaskAdmin {
return &TaskAdmin{conn: ra.conn}
}

// TaskRefs contains the action name and information about the image.
// PREVIEW
type TaskRefs struct {
Action string `json:"action"`
PoolName string `json:"pool_name"`
Expand All @@ -31,7 +28,6 @@ type TaskRefs struct {
}

// TaskResponse contains the information about the task added on an image.
// PREVIEW
type TaskResponse struct {
Sequence int `json:"sequence"`
ID string `json:"id"`
Expand All @@ -58,7 +54,6 @@ func parseTaskResponseList(res commands.Response) ([]TaskResponse, error) {

// AddFlatten adds a background task to flatten a cloned image based on the
// supplied image spec.
// PREVIEW
//
// Similar To:
// rbd task add flatten <image_spec>
Expand All @@ -73,7 +68,6 @@ func (ta *TaskAdmin) AddFlatten(img ImageSpec) (TaskResponse, error) {

// AddRemove adds a background task to remove an image based on the supplied
// image spec.
// PREVIEW
//
// Similar To:
// rbd task add remove <image_spec>
Expand All @@ -88,7 +82,6 @@ func (ta *TaskAdmin) AddRemove(img ImageSpec) (TaskResponse, error) {

// AddTrashRemove adds a background task to remove an image from the trash based
// on the supplied image id spec.
// PREVIEW
//
// Similar To:
// rbd task add trash remove <image_id_spec>
Expand All @@ -102,7 +95,6 @@ func (ta *TaskAdmin) AddTrashRemove(img ImageSpec) (TaskResponse, error) {
}

// List pending or running asynchronous tasks.
// PREVIEW
//
// Similar To:
// rbd task list
Expand All @@ -115,7 +107,6 @@ func (ta *TaskAdmin) List() ([]TaskResponse, error) {
}

// GetTaskByID returns pending or running asynchronous task using id.
// PREVIEW
//
// Similar To:
// rbd task list <task_id>
Expand All @@ -129,7 +120,6 @@ func (ta *TaskAdmin) GetTaskByID(taskID string) (TaskResponse, error) {
}

// Cancel a pending or running asynchronous task.
// PREVIEW
//
// Similar To:
// rbd task cancel <task_id>
Expand Down
4 changes: 2 additions & 2 deletions rbd/admin/task_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview
//go:build !nautilus
// +build !nautilus

package admin

Expand Down

0 comments on commit 7d88103

Please sign in to comment.