Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.01 KB

File metadata and controls

31 lines (22 loc) · 1.01 KB

back to overview

Create System

The creation of a new system is very easy as a lot of depending actions are done in the backend already.

A system always needs to have a system type. The list of types can be fetched via the API as well. Use the getSystemTypes endpoint for that.

PHP

/** @var SystemRepository $repo */
$repo = $client->getRepository('system');

$user = $client->getClusterUser();

$systemdTypeId = 1;

$systemDetails = [
    'name' => 'My new project',
    'base_url' => 'https://www.example.com',
    'owner' => $user['id'],
    'system_type' => $systemdTypeId,
    'add_standard_alerting' => true
];

$systemResult = $repo->createSystem($systemDetails);