Sha256: 5d74d3490ebbf190021d8e3d8cf498f526ac6af0b2b77460fd3bd3fc599b5c31

Contents?: true

Size: 948 Bytes

Versions: 1

Compression:

Stored size: 948 Bytes

Contents

import React from 'react';
import { translate as __ } from 'foremanReact/common/I18n';
import { get, post } from 'foremanReact/redux/API';
import { CONFIGURE_CLOUD_CONNECTOR } from './CloudConnectorConstants';
import { inventoryUrl } from '../../../../ForemanInventoryHelpers';
import { foremanUrl } from '../../../../../ForemanRhCloudHelpers';

export const configureCloudConnector = () =>
  post({
    key: CONFIGURE_CLOUD_CONNECTOR,
    url: inventoryUrl('cloud_connector'),
    successToast: response => (
      <span>
        {__('Cloud connector setup is in progress now: ')}
        <a href={foremanUrl(`/job_invocations/${response.data.id}`)}>
          {__('Cloud connector job link')}
        </a>
      </span>
    ),
    errorToast: error => `${__('Cloud connector setup has failed: ')} ${error}`,
  });

export const getCloudConnector = () =>
  get({
    key: CONFIGURE_CLOUD_CONNECTOR,
    url: inventoryUrl('cloud_connector'),
  });

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.15 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorActions.js