Class 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
    • Constructor Detail

      • Scm

        public Scm()
    • 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 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.
      • validateAndCreate

        @PUT
        @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.