Trees | Indices | Help |
|
---|
|
Remote API resource implementations.
According to RFC2616 the main difference between PUT and POST is that POST can create new resources but PUT can only create the resource the URI was pointing to on the PUT request.
In the context of this module POST on ``/2/instances`` to change an existing entity is legitimate, while PUT would not be. PUT creates a new entity (e.g. a new instance) with a name specified in the request.
Quoting from RFC2616, section 9.6:
The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations. In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response; the user agent MAY then make its own decision regarding whether or not to redirect the request.
So when adding new methods, if they are operating on the URI entity itself, PUT should be prefered over POST.
|
|||
R_version /version resource. |
|||
R_2_info /2/info resource. |
|||
R_2_features /2/features resource. |
|||
R_2_os /2/os resource. |
|||
R_2_redist_config /2/redistribute-config resource. |
|||
R_2_cluster_modify /2/modify resource. |
|||
R_2_jobs /2/jobs resource. |
|||
R_2_jobs_id /2/jobs/[job_id] resource. |
|||
R_2_jobs_id_wait /2/jobs/[job_id]/wait resource. |
|||
R_2_nodes /2/nodes resource. |
|||
R_2_nodes_name /2/nodes/[node_name] resource. |
|||
R_2_nodes_name_role /2/nodes/[node_name]/role resource. |
|||
R_2_nodes_name_evacuate /2/nodes/[node_name]/evacuate resource. |
|||
R_2_nodes_name_migrate /2/nodes/[node_name]/migrate resource. |
|||
R_2_nodes_name_storage /2/nodes/[node_name]/storage resource. |
|||
R_2_nodes_name_storage_modify /2/nodes/[node_name]/storage/modify resource. |
|||
R_2_nodes_name_storage_repair /2/nodes/[node_name]/storage/repair resource. |
|||
R_2_groups /2/groups resource. |
|||
R_2_groups_name /2/groups/[group_name] resource. |
|||
R_2_groups_name_modify /2/groups/[group_name]/modify resource. |
|||
R_2_groups_name_rename /2/groups/[group_name]/rename resource. |
|||
R_2_groups_name_assign_nodes /2/groups/[group_name]/assign-nodes resource. |
|||
R_2_instances /2/instances resource. |
|||
R_2_instances_name /2/instances/[instance_name] resource. |
|||
R_2_instances_name_info /2/instances/[instance_name]/info resource. |
|||
R_2_instances_name_reboot /2/instances/[instance_name]/reboot resource. |
|||
R_2_instances_name_startup /2/instances/[instance_name]/startup resource. |
|||
R_2_instances_name_shutdown /2/instances/[instance_name]/shutdown resource. |
|||
R_2_instances_name_reinstall /2/instances/[instance_name]/reinstall resource. |
|||
R_2_instances_name_replace_disks /2/instances/[instance_name]/replace-disks resource. |
|||
R_2_instances_name_activate_disks /2/instances/[instance_name]/activate-disks resource. |
|||
R_2_instances_name_deactivate_disks /2/instances/[instance_name]/deactivate-disks resource. |
|||
R_2_instances_name_prepare_export /2/instances/[instance_name]/prepare-export resource. |
|||
R_2_instances_name_export /2/instances/[instance_name]/export resource. |
|||
R_2_instances_name_migrate /2/instances/[instance_name]/migrate resource. |
|||
R_2_instances_name_failover /2/instances/[instance_name]/failover resource. |
|||
R_2_instances_name_rename /2/instances/[instance_name]/rename resource. |
|||
R_2_instances_name_modify /2/instances/[instance_name]/modify resource. |
|||
R_2_instances_name_disk_grow /2/instances/[instance_name]/disk/[disk_index]/grow resource. |
|||
R_2_instances_name_console /2/instances/[instance_name]/console resource. |
|||
R_2_query /2/query/[resource] resource. |
|||
R_2_query_fields /2/query/[resource]/fields resource. |
|||
_R_Tags Quasiclass for tagging resources |
|||
R_2_instances_name_tags /2/instances/[instance_name]/tags resource. |
|||
R_2_nodes_name_tags /2/nodes/[node_name]/tags resource. |
|||
R_2_groups_name_tags /2/groups/[group_name]/tags resource. |
|||
R_2_tags /2/tags resource. |
|
|||
opcodes.OpGroupAdd |
|
||
opcodes.OpGroupSetParams |
|
||
opcodes.OpGroupRename |
|
||
opcodes.OpInstanceCreate |
|
||
opcodes.OpInstanceShutdown |
|
||
|
|||
opcodes.OpInstanceReplaceDisks |
|
||
opcodes.OpBackupExport |
|
||
opcodes.OpInstanceMigrate |
|
||
opcodes.OpInstanceRename |
|
||
opcodes.OpInstanceSetParams |
|
||
|
|||
|
|
|||
_COMMON_FIELDS = ["ctime", "mtime", "uuid", "serial_no", "tags"]
|
|||
I_FIELDS = ["name", "admin_state", "os", "pnode", "snodes", "d
|
|||
N_FIELDS = ["name", "offline", "master_candidate", "drained",
|
|||
G_FIELDS = ["alloc_policy", "name", "node_cnt", "node_list",]+
|
|||
J_FIELDS_BULK = ["id", "ops", "status", "summary", "opstatus",
|
|||
J_FIELDS = J_FIELDS_BULK+ ["oplog", "opresult",]
|
|||
_NR_DRAINED = "drained"
|
|||
_NR_MASTER_CANDIATE = "master-candidate"
|
|||
_NR_MASTER = "master"
|
|||
_NR_OFFLINE = "offline"
|
|||
_NR_REGULAR = "regular"
|
|||
_NR_MAP = {constants.NR_MASTER: _NR_MASTER, constants.NR_MCAND
|
|||
_REQ_DATA_VERSION = "__version__"
|
|||
_INST_CREATE_REQV1 = "instance-create-reqv1"
|
|||
_INST_REINSTALL_REQV1 = "instance-reinstall-reqv1"
|
|||
_NODE_MIGRATE_REQV1 = "node-migrate-reqv1"
|
|||
_NODE_EVAC_RES1 = "node-evac-res1"
|
|||
ALL_FEATURES = frozenset([_INST_CREATE_REQV1, _INST_REINSTALL_
|
|||
_WFJC_TIMEOUT = 10
|
Imports: opcodes, http, constants, cli, rapi, ht, compat, baserlib
|
Parses a request for creating a node group.
|
Parses a request for modifying a node group.
|
Parses a request for renaming a node group.
|
Parses an instance creation request version 1.
|
Parses a request for an instance shutdown.
|
Parses a request for an instance export.
|
Parses a request for an instance export.
|
Parses a request for an instance migration.
|
Parses a request for renaming an instance.
|
Parses a request for modifying an instance.
|
|
I_FIELDS
|
N_FIELDS
|
G_FIELDS
|
J_FIELDS_BULK
|
_NR_MAP
|
ALL_FEATURES
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jul 24 16:51:19 2012 | http://epydoc.sourceforge.net |