How to use the @jenkins-cd/blueocean-core-js.UrlConfig.getRestBaseURL function in @jenkins-cd/blueocean-core-js

To help you get started, we’ve selected a few @jenkins-cd/blueocean-core-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jenkinsci / blueocean-plugin / blueocean-executor-info / src / main / js / ExecutorInfoService.js View on Github external
fetchExecutorInfo() {
        Fetch.fetchJSON(`${UrlConfig.getRestBaseURL()}/organizations/${AppConfig.getOrganizationName()}/computers/`)
        .then(response => {
            this.setComputers(response.computers);
        });
    }
}
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / bitbucket / api / BbCreationApi.js View on Github external
checkPipelineNameAvailable(name) {
        const path = UrlConfig.getRestBaseURL();
        const checkUrl = Utils.cleanSlashes(`${path}/organizations/${this.organization}/pipelines/${name}`);

        const fetchOptions = {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json',
            },
        };

        return this._fetch(checkUrl, { fetchOptions }).then(() => false, () => true);
    }
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / credentials / CredentialsApi.js View on Github external
function getCredentialsUrl(organization) {
    const path = UrlConfig.getRestBaseURL();
    return Utils.cleanSlashes(`${path}/organizations/${organization}/credentials/user/`);
}
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / credentials / CredentialsApi.js View on Github external
listAllCredentials() {
        const path = UrlConfig.getRestBaseURL();
        const searchUrl = Utils.cleanSlashes(`${path}/search?q=type:credential;organization:${this.organization}`, false);

        return this._fetch(searchUrl)
            .then(data => capabilityAugmenter.augmentCapabilities(data))
            .then(creds => this._listAllCredentialsSuccess(creds), error => this._listAllCredentialsFailure(error));
    }
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / git / GitCreationApi.js View on Github external
createPipeline(repositoryUrl, credentialId, name) {
        const path = UrlConfig.getRestBaseURL();
        const createUrl = Utils.cleanSlashes(`${path}/organizations/${this.organization}/pipelines`);

        const requestBody = {
            name,
            $class: 'io.jenkins.blueocean.blueocean_git_pipeline.GitPipelineCreateRequest',
            scmConfig: {
                uri: repositoryUrl,
                credentialId,
            },
        };

        const fetchOptions = {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / git / GitCreationApi.js View on Github external
checkPipelineNameAvailable(name) {
        const path = UrlConfig.getRestBaseURL();
        const checkUrl = Utils.cleanSlashes(`${path}/organizations/${this.organization}/pipelines/${name}`);

        const fetchOptions = {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json',
            },
        };

        return this._fetch(checkUrl, { fetchOptions }).then(() => false, () => true);
    }
}