How to use the taskcluster-client-web.request function in taskcluster-client-web

To help you get started, we’ve selected a few taskcluster-client-web 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 taskcluster / taskcluster-tools / src / views / UnifiedInspector / Inspector.jsx View on Github external
async getActions(props) {
    const { queue, taskGroupId } = props;

    if (!taskGroupId) {
      return;
    }

    try {
      const [decision, actions] = await Promise.all([
        queue.task(taskGroupId),
        request(
          queue.buildUrl(
            queue.getLatestArtifact,
            taskGroupId,
            'public/actions.json'
          ),
          { retries: 1 }
        )
      ]);

      return { decision, actions };
    } catch (err) {
      if (err.response && err.response.status !== 404) {
        throw err;
      }

      return { decision: null, actions: null };
github taskcluster / taskcluster-tools / src / views / AwsProvisioner / WorkerTypeResources.jsx View on Github external
this.setState({ actionLoading: true }, async () => {
      const credentials = await this.props.userSession.getCredentials();

      try {
        const url = urls.api(
          'ec2-manager',
          'v1',
          `/region/${region}/instance/${instanceId}`
        );

        await request(url, {
          extra: this.props.queue.buildExtraData(credentials),
          method: 'DELETE',
          credentials
        });

        const toast = {
          text: 'Terminate',
          icon: 
        };

        this.setState({
          actionLoading: false,
          toasts: this.state.toasts.concat(toast)
        });
      } catch (error) {
        this.setState({ error, actionLoading: false });
github taskcluster / taskcluster-tools / src / views / Provisioners / Provisioners.jsx View on Github external
this.setState({ actionLoading: true }, async () => {
      try {
        const credentials =
          (this.props.userSession &&
            (await this.props.userSession.getCredentials())) ||
          {};

        await request(url, {
          extra: this.props.queue.buildExtraData(credentials),
          credentials,
          method: action.method
        });

        const toast = {
          text: action.title,
          icon: 
        };

        this.setState({
          actionLoading: false,
          toasts: this.state.toasts.concat(toast)
        });
      } catch (error) {
        this.setState({ error, actionLoading: false });
github taskcluster / taskcluster-tools / src / views / WorkerManager / WorkerManager.jsx View on Github external
this.setState({ actionLoading: true }, async () => {
      try {
        const credentials =
          (this.props.userSession &&
            (await this.props.userSession.getCredentials())) ||
          {};

        await request(url, {
          extra: this.props.queue.buildExtraData(credentials),
          credentials,
          method: action.method
        });

        const toast = {
          text: action.title,
          icon: 
        };

        this.setState({
          actionLoading: false,
          toasts: this.state.toasts.concat(toast)
        });
      } catch (error) {
        this.setState({ error, actionLoading: false });
github taskcluster / taskcluster-tools / src / views / Workers / WorkerManager.jsx View on Github external
this.setState({ actionLoading: true }, async () => {
      try {
        const credentials =
          (this.props.userSession &&
            (await this.props.userSession.getCredentials())) ||
          {};

        await request(url, {
          extra: this.props.queue.buildExtraData(credentials),
          credentials,
          method: action.method
        });

        const toast = {
          text: action.title,
          icon: 
        };

        this.setState({
          actionLoading: false,
          toasts: this.state.toasts.concat(toast)
        });
      } catch (error) {
        this.setState({ error, actionLoading: false });

taskcluster-client-web

[![Download](https://img.shields.io/badge/yarn-taskcluster--client--web-brightgreen)](https://yarnpkg.com/en/package/taskcluster-client-web) [![License](https://img.shields.io/badge/license-MPL%202.0-orange.svg)](http://mozilla.org/MPL/2.0)

MPL-2.0
Latest version published 10 days ago

Package Health Score

66 / 100
Full package analysis

Similar packages