Class Scm
java.lang.Object
io.jenkins.blueocean.rest.model.Resource
io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
- All Implemented Interfaces:
io.jenkins.blueocean.rest.Reachable
- Direct Known Subclasses:
AbstractScm
public abstract class Scm
extends io.jenkins.blueocean.rest.model.Resource
Scm Resource
- Author:
- Vivek Pandey
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
credentialId attached to this scmabstract String
getId()
SCM id.abstract io.jenkins.blueocean.rest.model.Container<ScmOrganization>
Pageable list ofScmOrganization
s.abstract ScmServerEndpointContainer
List ofScmServerEndpoint
s.abstract String
getUri()
SCM URIabstract org.kohsuke.stapler.HttpResponse
validateAndCreate
(net.sf.json.JSONObject request) Validate given credential parameters for authentication and authorization.Methods inherited from class io.jenkins.blueocean.rest.model.Resource
getLinks, getState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jenkins.blueocean.rest.Reachable
getLink
-
Field Details
-
ID
- See Also:
-
URI
- See Also:
-
CREDENTIAL_ID
- See Also:
-
VALIDATE
- See Also:
-
X_CREDENTIAL_ID
- See Also:
-
-
Constructor Details
-
Scm
public Scm()
-
-
Method Details
-
getId
SCM id. For example, github, bitbucket etc. -
getUri
SCM URI -
getCredentialId
credentialId attached to this scm -
getOrganizations
@Navigable public abstract io.jenkins.blueocean.rest.model.Container<ScmOrganization> getOrganizations()Pageable list ofScmOrganization
s. Credential Id to use with github must be provided either as credentialId query parameter or as X-CREDENTIAL-NAME http header. credentialId query parameter overrides X-CREDENTIAL-NAME http header.- Returns:
Pageable
ScmOrganization
s.
-
getServers
List ofScmServerEndpoint
s. SCMs that do not support multiple instances can return empty list or null.- Returns:
- list of
ScmServerEndpoint
s
-
validateAndCreate
@POST @WebMethod(name="validate") @CheckForNull public abstract org.kohsuke.stapler.HttpResponse validateAndCreate(@JsonBody net.sf.json.JSONObject request) Validate given credential parameters for authentication and authorization. Response is { "credentialId": "....." } Validation of provided credential is scm dependent. If provided credential parameters (username, password or accessToken etc.) are not valid or do not carry expected scope (such as permission to update repo, basic user info, email etc.) then an error is returned. If there is already a Credentials object present then it's updated with provided credential parameters, otherwise new Credentials object is created and it's credential id is returned in the response.- Parameters:
request
- request object carrying credential parameters for this SCM- Returns:
- credential id. If accessToken is not applicable to this SCM, null is returned.
-