Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
78cdac84
Commit
78cdac84
authored
Jan 03, 2018
by
Luc Didry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose project_id on /api/v4/pages/domains
parent
e5a9b9a1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
1 deletion
+10
-1
changelogs/unreleased/api-domains-expose-project_id.yml
changelogs/unreleased/api-domains-expose-project_id.yml
+5
-0
doc/api/pages_domains.md
doc/api/pages_domains.md
+1
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-0
spec/fixtures/api/schemas/public_api/v4/pages_domain/basic.json
...ixtures/api/schemas/public_api/v4/pages_domain/basic.json
+2
-1
spec/requests/api/pages_domains_spec.rb
spec/requests/api/pages_domains_spec.rb
+1
-0
No files found.
changelogs/unreleased/api-domains-expose-project_id.yml
0 → 100644
View file @
78cdac84
---
title
:
Expose project_id on /api/v4/pages/domains
merge_request
:
16200
author
:
Luc Didry
type
:
changed
doc/api/pages_domains.md
View file @
78cdac84
...
@@ -21,6 +21,7 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/a
...
@@ -21,6 +21,7 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/a
{
{
"domain"
:
"ssl.domain.example"
,
"domain"
:
"ssl.domain.example"
,
"url"
:
"https://ssl.domain.example"
,
"url"
:
"https://ssl.domain.example"
,
"project_id"
:
1337
,
"certificate"
:
{
"certificate"
:
{
"expired"
:
false
,
"expired"
:
false
,
"expiration"
:
"2020-04-12T14:32:00.000Z"
"expiration"
:
"2020-04-12T14:32:00.000Z"
...
...
lib/api/entities.rb
View file @
78cdac84
...
@@ -1133,6 +1133,7 @@ module API
...
@@ -1133,6 +1133,7 @@ module API
class
PagesDomainBasic
<
Grape
::
Entity
class
PagesDomainBasic
<
Grape
::
Entity
expose
:domain
expose
:domain
expose
:url
expose
:url
expose
:project_id
expose
:certificate
,
expose
:certificate
,
as: :certificate_expiration
,
as: :certificate_expiration
,
if:
->
(
pages_domain
,
_
)
{
pages_domain
.
certificate?
},
if:
->
(
pages_domain
,
_
)
{
pages_domain
.
certificate?
},
...
...
spec/fixtures/api/schemas/public_api/v4/pages_domain/basic.json
View file @
78cdac84
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
"properties"
:
{
"properties"
:
{
"domain"
:
{
"type"
:
"string"
},
"domain"
:
{
"type"
:
"string"
},
"url"
:
{
"type"
:
"uri"
},
"url"
:
{
"type"
:
"uri"
},
"project_id"
:
{
"type"
:
"integer"
},
"certificate_expiration"
:
{
"certificate_expiration"
:
{
"type"
:
"object"
,
"type"
:
"object"
,
"properties"
:
{
"properties"
:
{
...
@@ -13,6 +14,6 @@
...
@@ -13,6 +14,6 @@
"additionalProperties"
:
false
"additionalProperties"
:
false
}
}
},
},
"required"
:
[
"domain"
,
"url"
],
"required"
:
[
"domain"
,
"url"
,
"project_id"
],
"additionalProperties"
:
false
"additionalProperties"
:
false
}
}
spec/requests/api/pages_domains_spec.rb
View file @
78cdac84
...
@@ -46,6 +46,7 @@ describe API::PagesDomains do
...
@@ -46,6 +46,7 @@ describe API::PagesDomains do
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
size
).
to
eq
(
3
)
expect
(
json_response
.
size
).
to
eq
(
3
)
expect
(
json_response
.
last
).
to
have_key
(
'domain'
)
expect
(
json_response
.
last
).
to
have_key
(
'domain'
)
expect
(
json_response
.
last
).
to
have_key
(
'project_id'
)
expect
(
json_response
.
last
).
to
have_key
(
'certificate_expiration'
)
expect
(
json_response
.
last
).
to
have_key
(
'certificate_expiration'
)
expect
(
json_response
.
last
[
'certificate_expiration'
][
'expired'
]).
to
be
true
expect
(
json_response
.
last
[
'certificate_expiration'
][
'expired'
]).
to
be
true
expect
(
json_response
.
first
).
not_to
have_key
(
'certificate_expiration'
)
expect
(
json_response
.
first
).
not_to
have_key
(
'certificate_expiration'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment