Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetActuate PHP SDK

PHP 8.1 client for NetActuate vAPI2 and vAPI3.

Install

composer require netactuate/naphp

Authentication

Pass an API key when constructing a client, or set NETACTUATE_API_KEY.

use NetActuate\Naphp\Client;
use NetActuate\Naphp\V3Client;

$vapi2 = new Client();
$vapi3 = new V3Client();

The key is sent as the platform key query parameter and is redacted from SDK error text.

Clients

Client talks to vAPI2, which covers cloud servers and DNS in this first release.

V3Client talks to vAPI3, which covers VPCs, storage buckets and NKE clusters in this first release.

Both clients accept an optional base URL for tests or private environments:

$client = new V3Client(apiKey: '...', baseUrl: 'https://vapi3.example');
foreach ($client->listVpcs() as $vpc) {
    echo $vpc->vpcId . ' ' . ($vpc->metadata['label'] ?? '') . PHP_EOL;
}

foreach ($client->listStorageBuckets() as $bucket) {
    echo $bucket->bucketId . ' ' . ($bucket->metadata['label'] ?? '') . PHP_EOL;
}

foreach ($client->listNkeClusters() as $cluster) {
    echo $cluster->clusterId . ' ' . $cluster->name . PHP_EOL;
}

Covered Calls

vAPI2:

  • getServers()
  • getServer($id)
  • listZones($type = '')
  • getZone($id)
  • listRecords($zoneId)
  • getRecord($id)

vAPI3:

  • listVpcs()
  • getVpc($id)
  • listStorageBuckets()
  • getStorageBucket($id)
  • listNkeClusters()
  • getNkeCluster($id)

The vAPI3 client follows all supported list envelope forms through pagination.

Errors

All failures raise NetActuate\Naphp\Exception\ApiError or a subclass.

  • NotFoundError is raised for missing resources in both API versions.
  • ContractError is raised for contract gated capabilities.

Documentation

Platform documentation lives at https://netactuate.com/docs.

About

PHP SDK for the NetActuate API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages