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
Fields Modifier and Type Field Description static String
CREDENTIAL_ID
static String
ID
static String
URI
static String
VALIDATE
static String
X_CREDENTIAL_ID
-
Constructor Summary
Constructors Constructor Description Scm()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract String
getCredentialId()
credentialId attached to this scmabstract String
getId()
SCM id.abstract io.jenkins.blueocean.rest.model.Container<ScmOrganization>
getOrganizations()
Pageable list ofScmOrganization
s.abstract ScmServerEndpointContainer
getServers()
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.
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
URI
public static final String URI
- See Also:
- Constant Field Values
-
CREDENTIAL_ID
public static final String CREDENTIAL_ID
- See Also:
- Constant Field Values
-
VALIDATE
public static final String VALIDATE
- See Also:
- Constant Field Values
-
X_CREDENTIAL_ID
public static final String X_CREDENTIAL_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
@Exported(name="id") @NonNull public abstract String getId()
SCM id. For example, github, bitbucket etc.
-
getUri
@Exported(name="uri") @NonNull public abstract String getUri()
SCM URI
-
getCredentialId
@Exported(name="credentialId") @CheckForNull public abstract String 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
@Navigable public abstract ScmServerEndpointContainer 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.
-
-