14. util – Utilities

Utility functionality.

14.1. Resources

14.1.1. ErrCodes

class util.ErrCodes

This resources represents the potential error codes that may be returned by any given resource.

Resource URI:

/rest/hosting/errcodes/
GET()

Return the available error codes.

Note

This resource requires read permission on the elastic_hosting extension module when using the HTTP GET method.

Return type:util.RepErrCodes

14.1.2. I18N

class util.I18N

This resource represents the language labels used in the user interface.

Resource URI:

/rest/hosting/i18n/
GET(locale)

Return the language labels used in the user interface by submitting an HTTP GET request.

Note

This resource requires read permission on the elastic_hosting extension module when using the HTTP GET method.

Parameter:locale – The locale of the translations to return.
Return type:util.RepI18N

14.1.3. IconMap

class util.IconMap

This resource represents the icons for operation systems and applications used in the user interface.

Resource URI:

/rest/hosting/iconmap/
GET()

Return the icons used in the user interface.

Note

This resource requires read permission on the elastic_hosting extension module when using the HTTP GET method.

Return type:util.RepIconMap

14.2. Representations

14.2.1. RepErrCodes

class util.RepErrCodes

This is a representation of the available API error codes.

errno
This attribute represents the general error number generated by the resource.
message
This attribute represents the general error message generated by the resource.
errcodes
This attribute represents the errcode dictionary.

Representation:

{"errno": response.errno,
 "message": response.message,
 "errcodes": {"err_label": err.number}}

14.2.2. RepI18N

class util.RepI18N

This is a representation of language labels used in the user interface.

errno
This attribute represents the general error number generated by the resource.
message
This attribute represents the general error message generated by the resource.
i18n
This attribute represents the dictionary of language translations.

Representation:

{"errno": response.errno,
 "message": response.message,
 "i18n": {"current": i18n.current,
          "supported": i18n.supported,
          "i18n_label": i18n.translation}}

14.2.3. RepIconMap

class util.RepIconMap

This is a representation of the icons used in the user interface.

errno
This attribute represents the general error number generated by the resource.
message
This attribute represents the general error message generated by the resource.
icons
This attribute represents the dictionary of operating system icons.

Representation:

{"errno": response.errno,
 "message": response.message,
 "icons": {"base_path": "/path/",
           "os_label": {"small": os.small,
                        "medium": os.medium}}}