Skip to content

Commit e648401

Browse files
authored
Merge pull request #248 from stackhpc/upstream/master-2026-01-19
Synchronise master with upstream
2 parents ffed333 + 03b5b42 commit e648401

22 files changed

Lines changed: 119 additions & 165 deletions

File tree

api-ref/source/quotas.inc

100755100644
File mode changed.

api-ref/source/samples/quota-delete-req.json

100755100644
File mode changed.

api-ref/source/samples/quota-update-req.json

100755100644
File mode changed.

magnum/api/controllers/link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
def build_url(resource, resource_args, bookmark=False, base_url=None):
2323
if base_url is None:
24-
base_url = pecan.request.host_url
24+
base_url = pecan.request.application_url
2525

2626
template = '%(url)s/%(res)s' if bookmark else '%(url)s/v1/%(res)s'
2727
# FIXME(lucasagomes): I'm getting a 404 when doing a GET on

magnum/api/controllers/root.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ class Version(base.APIBase):
4545
def convert(id, status, max, min):
4646
version = Version()
4747
version.id = id
48-
version.links = [link.Link.make_link('self', pecan.request.host_url,
49-
id, '', bookmark=True)]
48+
version.links = [
49+
link.Link.make_link(
50+
'self', pecan.request.application_url, id, '', bookmark=True)]
5051
version.status = status
5152
version.max_version = max
5253
version.min_version = min

magnum/api/controllers/v1/__init__.py

Lines changed: 67 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -106,72 +106,73 @@ class V1(controllers_base.APIBase):
106106
def convert():
107107
v1 = V1()
108108
v1.id = "v1"
109-
v1.links = [link.Link.make_link('self', pecan.request.host_url,
110-
'v1', '', bookmark=True),
111-
link.Link.make_link('describedby',
112-
'http://docs.openstack.org',
113-
'developer/magnum/dev',
114-
'api-spec-v1.html',
115-
bookmark=True, type='text/html')]
116-
v1.media_types = [MediaType('application/json',
117-
'application/vnd.openstack.magnum.v1+json')]
118-
v1.clustertemplates = [link.Link.make_link('self',
119-
pecan.request.host_url,
120-
'clustertemplates', ''),
121-
link.Link.make_link('bookmark',
122-
pecan.request.host_url,
123-
'clustertemplates', '',
124-
bookmark=True)]
125-
v1.clusters = [link.Link.make_link('self', pecan.request.host_url,
126-
'clusters', ''),
127-
link.Link.make_link('bookmark',
128-
pecan.request.host_url,
129-
'clusters', '',
130-
bookmark=True)]
131-
v1.quotas = [link.Link.make_link('self', pecan.request.host_url,
132-
'quotas', ''),
133-
link.Link.make_link('bookmark',
134-
pecan.request.host_url,
135-
'quotas', '',
136-
bookmark=True)]
137-
v1.certificates = [link.Link.make_link('self', pecan.request.host_url,
138-
'certificates', ''),
139-
link.Link.make_link('bookmark',
140-
pecan.request.host_url,
141-
'certificates', '',
142-
bookmark=True)]
143-
v1.mservices = [link.Link.make_link('self', pecan.request.host_url,
144-
'mservices', ''),
145-
link.Link.make_link('bookmark',
146-
pecan.request.host_url,
147-
'mservices', '',
148-
bookmark=True)]
149-
v1.stats = [link.Link.make_link('self', pecan.request.host_url,
150-
'stats', ''),
151-
link.Link.make_link('bookmark',
152-
pecan.request.host_url,
153-
'stats', '',
154-
bookmark=True)]
155-
v1.federations = [link.Link.make_link('self', pecan.request.host_url,
156-
'federations', ''),
157-
link.Link.make_link('bookmark',
158-
pecan.request.host_url,
159-
'federations', '',
160-
bookmark=True)]
161-
v1.nodegroups = [link.Link.make_link('self', pecan.request.host_url,
162-
'clusters/{cluster_id}',
163-
'nodegroups'),
164-
link.Link.make_link('bookmark',
165-
pecan.request.host_url,
166-
'clusters/{cluster_id}',
167-
'nodegroups',
168-
bookmark=True)]
169-
v1.credentials = [link.Link.make_link('self', pecan.request.host_url,
170-
'credentials', ''),
171-
link.Link.make_link('bookmark',
172-
pecan.request.host_url,
173-
'credentials', '',
174-
bookmark=True)]
109+
v1.links = [
110+
link.Link.make_link(
111+
'self', pecan.request.application_url, 'v1', '',
112+
bookmark=True),
113+
link.Link.make_link(
114+
'describedby', 'http://docs.openstack.org',
115+
'developer/magnum/dev', 'api-spec-v1.html', bookmark=True,
116+
type='text/html')]
117+
v1.media_types = [
118+
MediaType(
119+
'application/json',
120+
'application/vnd.openstack.magnum.v1+json')]
121+
v1.clustertemplates = [
122+
link.Link.make_link(
123+
'self', pecan.request.application_url, 'clustertemplates', ''),
124+
link.Link.make_link(
125+
'bookmark', pecan.request.application_url, 'clustertemplates',
126+
'', bookmark=True)]
127+
v1.clusters = [
128+
link.Link.make_link(
129+
'self', pecan.request.application_url, 'clusters', ''),
130+
link.Link.make_link(
131+
'bookmark', pecan.request.application_url, 'clusters', '',
132+
bookmark=True)]
133+
v1.quotas = [
134+
link.Link.make_link(
135+
'self', pecan.request.application_url, 'quotas', ''),
136+
link.Link.make_link(
137+
'bookmark', pecan.request.application_url, 'quotas', '',
138+
bookmark=True)]
139+
v1.certificates = [
140+
link.Link.make_link(
141+
'self', pecan.request.application_url, 'certificates', ''),
142+
link.Link.make_link(
143+
'bookmark', pecan.request.application_url, 'certificates', '',
144+
bookmark=True)]
145+
v1.mservices = [
146+
link.Link.make_link(
147+
'self', pecan.request.application_url, 'mservices', ''),
148+
link.Link.make_link(
149+
'bookmark', pecan.request.application_url, 'mservices', '',
150+
bookmark=True)]
151+
v1.stats = [
152+
link.Link.make_link(
153+
'self', pecan.request.application_url, 'stats', ''),
154+
link.Link.make_link(
155+
'bookmark', pecan.request.application_url, 'stats', '',
156+
bookmark=True)]
157+
v1.federations = [
158+
link.Link.make_link(
159+
'self', pecan.request.application_url, 'federations', ''),
160+
link.Link.make_link(
161+
'bookmark', pecan.request.application_url, 'federations', '',
162+
bookmark=True)]
163+
v1.nodegroups = [
164+
link.Link.make_link(
165+
'self', pecan.request.application_url, 'clusters/{cluster_id}',
166+
'nodegroups'),
167+
link.Link.make_link(
168+
'bookmark', pecan.request.application_url,
169+
'clusters/{cluster_id}', 'nodegroups', bookmark=True)]
170+
v1.credentials = [
171+
link.Link.make_link(
172+
'self', pecan.request.application_url, 'credentials', ''),
173+
link.Link.make_link(
174+
'bookmark', pecan.request.application_url, 'credentials', '',
175+
bookmark=True)]
175176

176177
return v1
177178

magnum/api/controllers/v1/certificate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ def _convert_with_links(certificate, url, expand=True):
122122
@classmethod
123123
def convert_with_links(cls, rpc_cert, expand=True):
124124
cert = Certificate(**rpc_cert.as_dict())
125-
return cls._convert_with_links(cert,
126-
pecan.request.host_url, expand)
125+
return cls._convert_with_links(
126+
cert, pecan.request.application_url, expand)
127127

128128
@classmethod
129129
def sample(cls, expand=True):

magnum/api/controllers/v1/cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ def _convert_with_links(cluster, url, expand=True, parent_labels=None):
229229
def convert_with_links(cls, rpc_cluster, expand=True):
230230
cluster = Cluster(**rpc_cluster.as_dict())
231231
parent_labels = rpc_cluster.cluster_template.labels
232-
return cls._convert_with_links(cluster, pecan.request.host_url, expand,
233-
parent_labels)
232+
return cls._convert_with_links(
233+
cluster, pecan.request.application_url, expand, parent_labels)
234234

235235
@classmethod
236236
def sample(cls, expand=True):

magnum/api/controllers/v1/cluster_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ def _convert_with_links(cluster_template, url):
188188
@classmethod
189189
def convert_with_links(cls, rpc_cluster_template):
190190
cluster_template = ClusterTemplate(**rpc_cluster_template.as_dict())
191-
return cls._convert_with_links(cluster_template,
192-
pecan.request.host_url)
191+
return cls._convert_with_links(
192+
cluster_template, pecan.request.application_url)
193193

194194
@classmethod
195195
def sample(cls):

magnum/api/controllers/v1/collection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ def get_next(self, limit, url=None, marker_attribute='uuid', **kwargs):
4444
'args': q_args, 'limit': limit,
4545
'marker': getattr(self.collection[-1], marker_attribute)}
4646

47-
return link.Link.make_link('next', pecan.request.host_url,
48-
resource_url, next_args).href
47+
return link.Link.make_link(
48+
'next', pecan.request.application_url, resource_url, next_args
49+
).href

0 commit comments

Comments
 (0)