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 Details

  • Constructor Details

    • Scm

      public Scm()
  • Method Details

    • 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 of ScmOrganizations. 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 ScmOrganizations.
    • getServers

      @Navigable public abstract ScmServerEndpointContainer getServers()
      List of ScmServerEndpoints. SCMs that do not support multiple instances can return empty list or null.
      Returns:
      list of ScmServerEndpoints
    • 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.