Package ganeti :: Package rapi :: Module rlib2 :: Class _R_Tags
[hide private]
[frames] | no frames]

Class _R_Tags

source code


Quasiclass for tagging resources

Manages tags. When inheriting this class you must define the TAG_LEVEL for it.

Instance Methods [hide private]
 
__init__(self, items, queryargs, req)
A tag resource constructor.
source code
 
GET(self)
Returns a list of tags.
source code
 
PUT(self)
Add a set of tags.
source code
 
DELETE(self)
Delete a tag.
source code

Inherited from baserlib.R_Generic: dryRun, getBodyParameter, useBulk, useForce, useLocking

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  TAG_LEVEL = None

Inherited from baserlib.R_Generic: DELETE_ACCESS, GET_ACCESS, POST_ACCESS, PUT_ACCESS, request_body

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, items, queryargs, req)
(Constructor)

source code 

A tag resource constructor.

We have to override the default to sort out cluster naming case.

Parameters:
  • items - a list with variables encoded in the URL
  • queryargs - a dictionary with additional options from URL
Overrides: object.__init__

GET(self)

source code 

Returns a list of tags.

Example: ["tag1", "tag2", "tag3"]

PUT(self)

source code 

Add a set of tags.

The request as a list of strings should be PUT to this URI. And you'll have back a job id.

DELETE(self)

source code 

Delete a tag.

In order to delete a set of tags, the DELETE request should be addressed to URI like: /tags?tag=[tag]&tag=[tag]