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_root / resource. |
|||
R_2 /2 resource. |
|||
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_powercycle /2/nodes/[node_name]/powercycle 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_modify /2/nodes/[node_name]/modify 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_networks /2/networks resource. |
|||
R_2_networks_name /2/networks/[network_name] resource. |
|||
R_2_networks_name_connect /2/networks/[network_name]/connect resource. |
|||
R_2_networks_name_disconnect /2/networks/[network_name]/disconnect resource. |
|||
R_2_networks_name_modify /2/networks/[network_name]/modify 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_multi_alloc /2/instances-multi-alloc 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_recreate_disks /2/instances/[instance_name]/recreate-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_networks_name_tags /2/networks/[network_name]/tags resource. |
|||
R_2_tags /2/tags resource. |
|
|||
|
|||
|
|||
|
|||
list of string |
|
||
list of string |
|
|
|||
_COMMON_FIELDS = ["ctime", "mtime", "uuid", "serial_no", "tags"]
|
|||
I_FIELDS = ["name", "admin_state", "os", "pnode", "snodes", "d
|
|||
N_FIELDS = ["name", "offline", "master_candidate", "drained",
|
|||
NET_FIELDS = ["name", "network", "gateway", "network6", "gatew
|
|||
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_CANDIDATE = "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 = compat.UniqueFrozenset([_INST_CREATE_REQV1, _IN
|
|||
_WFJC_TIMEOUT = 10
|
Imports: opcodes, objects, http, constants, cli, rapi, ht, compat, ssconf, baserlib
|
Updates the beparams dict of inst to support the memory field.
|
Convert in place the usb_devices string to the proper format. In Ganeti 2.8.4 the separator for the usb_devices hvparam was changed from comma to space because commas cannot be accepted on the command line (they already act as the separator between different hvparams). RAPI should be able to accept commas for backwards compatibility, but we want it to also accept the new space separator. Therefore, we convert spaces into commas here and keep the old parsing logic elsewhere. |
Tries to extract
|
Splits fields as given for a query request.
|
|
I_FIELDS
|
N_FIELDS
|
NET_FIELDS
|
G_FIELDS
|
J_FIELDS_BULK
|
_NR_MAP
|
ALL_FEATURES
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Dec 30 13:42:34 2015 | http://epydoc.sourceforge.net |