~lutostag/ubuntu/trusty/maas/1.5.4+keystone

« back to all changes in this revision

Viewing changes to src/metadataserver/urls.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2013-03-04 11:49:44 UTC
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: package-import@ubuntu.com-20130304114944-azcvu9anlf8mizpa
Tags: upstream-1.3+bzr1452+dfsg
ImportĀ upstreamĀ versionĀ 1.3+bzr1452+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
    patterns,
19
19
    url,
20
20
    )
21
 
from maasserver.api import OperationsResource
22
21
from maasserver.api_auth import api_auth
 
22
from maasserver.api_support import OperationsResource
23
23
from metadataserver.api import (
24
24
    AnonMetaDataHandler,
 
25
    CommissioningScriptsHandler,
25
26
    EnlistMetaDataHandler,
26
27
    EnlistUserDataHandler,
27
28
    EnlistVersionIndexHandler,
40
41
    VersionIndexHandler, authentication=api_auth)
41
42
index_handler = OperationsResource(
42
43
    IndexHandler, authentication=api_auth)
 
44
commissioning_scripts_handler = OperationsResource(
 
45
    CommissioningScriptsHandler, authentication=api_auth)
43
46
 
44
47
 
45
48
# Handlers for anonymous metadata operations.
58
61
enlist_version_index_handler = OperationsResource(EnlistVersionIndexHandler)
59
62
 
60
63
# Normal metadata access, available to a node querying its own metadata.
 
64
#
 
65
# The URL patterns must tolerate redundant leading slashes, because
 
66
# cloud-init tends to add these.
61
67
node_patterns = patterns(
62
68
    '',
63
69
    url(
64
 
        # could-init adds additional slashes in front of urls.
65
70
        r'^/*(?P<version>[^/]+)/meta-data/(?P<item>.*)$',
66
71
        meta_data_handler,
67
72
        name='metadata-meta-data'),
68
73
    url(
69
 
        # could-init adds additional slashes in front of urls.
70
74
        r'^/*(?P<version>[^/]+)/user-data$', user_data_handler,
71
75
        name='metadata-user-data'),
72
 
    url(
73
 
        # could-init adds additional slashes in front of urls.
 
76
    # Commissioning scripts.  This is a blatant MAAS extension to the
 
77
    # metadata API, hence the "maas-" prefix.
 
78
    # Scripts are returned as a tar arhive, but the format is not
 
79
    # reflected in the http filename.  The response's MIME type is
 
80
    # definitive.  We may yet choose to compress the file, without
 
81
    # changing its name on the API.
 
82
    url(
 
83
        r'^/*(?P<version>[^/]+)/maas-commissioning-scripts',
 
84
        commissioning_scripts_handler, name='commissioning-scripts'),
 
85
    url(
74
86
        r'^/*(?P<version>[^/]+)/', version_index_handler,
75
87
        name='metadata-version'),
76
88
    url(
77
 
        # could-init adds additional slashes in front of urls.
78
89
        r'^/*', index_handler, name='metadata'),
79
90
    )
80
91