-
Notifications
You must be signed in to change notification settings - Fork 13
Fetching template info by name
Obtain template info by name ../info?name=master
(Note: 1 template info at most must be returned by this endpoint or 404 Not found )
This REST has mandatory parameter name
and optional parameters owner
and token
.
So we have these combinations (if optional parameter is missing or empty or invalid then it must be considered missing):
- name (e.g
/info?name=master
) - name + owner (e.g.
/info?name=master&owner={owner}
) - name + token (e.g.
/info?name=master&token={token}
) - name + owner + token (e.g.
/info?name=master&owner={owner}&token={token}
)
Search is done this way:
-
CDN searches template only within verified templates (owner Jenkins/Subutai)
-
CDN searches template only within the specified owner's templates (specified owner's public templates)
-
needs special treatment:
a) if token is valid (not empty, not missing, and gets authed successfully) then CDN must use token's user as owner and search using template name and user as owner (thus it searches within the authed user's own templates or templates shared with him).
If it does not find there then it searches within verified templates.
If special flagverified=true
provided then search is done only within verified templates regardless of tokenb) in case of invalid token it searches within verified templates
-
the same as #2 (if token is valid then searches also among private/shared templates of the specified owner, token must belong to the specified owner)
Note: if version
parameter is passed, it is used to further filter the searched set by the supplied version.
Note about fetching templates by ID: When template is fetched by ID, it is searched within all public templates. If token is specified, then search is done within all accessible templates: all public templates + the token holder's private templates + templates shared with the token holder