netzfabrik/netzfabrik-php-api

dev-main 2023-06-12 08:03 UTC

This package is not auto-updated.

Last update: 2024-05-14 10:49:15 UTC


README

PHP client library for the NETZFABRIK API

For more information, please visit https://www.netzfabrik.com.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/NETZFABRIKCOM/netzfabrik-php-api.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/netzfabrik-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: JWT
$config = NETZFABRIK\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = NETZFABRIK\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new NETZFABRIK\Api\AccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 'id_example'; // string | Account identifier

try {
    $result = $apiInstance->getAccount($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
AccountApi getAccount GET /accounts/{id} Get an account
AccountApi getUserAccounts GET /user/accounts Get the current user's accounts
ApplicationApi getApplication GET /applications/{id} Get managed application
ApplicationApi getApplications GET /applications Get managed applications
ApplicationApi restartApplication POST /applications/{id}/restart Restart managed application
ApplicationApi startApplication POST /applications/{id}/start Start managed application
ApplicationApi stopApplication POST /applications/{id}/stop Stop managed application
CloudServerApi deleteServer POST /cloud-servers/{id}/delete Delete server
CloudServerApi getServer GET /cloud-servers/{id} Get server
CloudServerApi getServerStatistics GET /cloud-servers/{id}/statistics Get server statistics
CloudServerApi getServers GET /cloud-servers Get servers
CloudServerApi restartServer POST /cloud-servers/{id}/restart Restart server
CloudServerApi shutdownServer POST /cloud-servers/{id}/shutdown Shutdown server
CloudServerApi startServer POST /cloud-servers/{id}/start Start server
CloudServerApi stopServer POST /cloud-servers/{id}/stop Stop server
CloudVolumeApi apiCloudVolumesIdDelete DELETE /cloud-volumes/{id} Removes the Volume resource.
CloudVolumeApi attachVolumeToServer POST /cloud-servers/{id}/volume Add volume to server
CloudVolumeApi detachVolumeFromServer POST /cloud-servers/{id}/volume/{volumeId} Detach volume from server
CloudVolumeApi getVolume GET /cloud-volumes/{id} Get volume
ColocationApi addColocation POST /colocations Add a colocation
ColocationApi getColocation GET /colocations/{id} Get a colocation
ColocationApi getColocationInterconnections GET /colocations/{id}/interconnections Get the interconnections of a colocation
ColocationApi getColocationPowerFeeds GET /colocations/{id}/power-feeds Get the power feeds of a colocation
CustomerApi createCustomer POST /customers Create a new customer
DomainApi cancelDomain POST /domains/{id}/cancel Cancel a domain on the given date. If no date is given, the domain will be cancelled immediately.
DomainApi checkDomainAvailability POST /domains/check-availability Check if a domain is available
DomainApi createHandle POST /handles Create a new handle
DomainApi deleteDomainAuthCode DELETE /domains/{id}/auth-code Request the auth code for a domain
DomainApi deleteDomainTransferLock DELETE /domains/{id}/transfer-lock Delete the transfer lock for a domain. This is not available for .de domains.
DomainApi getDomain GET /domains/{id} Get a domain by id
DomainApi getDomains GET /domains Get the current domains
DomainApi getHandle GET /handles/{id} Get a handle by id
DomainApi getHandles GET /handles Get the current handles
DomainApi postDomain POST /domains Register a new domain
DomainApi retrieveDomainAuthCode POST /domains/{id}/auth-code Request the auth code for a domain
DomainApi revokeCancelDomain DELETE /domains/{id}/cancel Revokes the cancellation of a domain.
DomainApi setDomainTransferLock POST /domains/{id}/transfer-lock Set the transfer lock for a domain. This is not available for .de domains.
DomainApi transitDomain POST /domains/{id}/transit Gives the domain to the registrar. This is only available for .de domains.
DomainResellerApi getDomainReseller GET /domain-reseller Retrieves a DomainReseller resource.
DomainResellerApi getDomainResellerBillingData GET /domain-reseller/billing-data Retrieves the collection of DomainReseller resources.
InterconnectionApi getInterconnection GET /interconnections/{id} Get an interconnection
InvoiceApi downloadInvoice GET /invoices/{id}/download Download invoice
InvoiceApi getInvoice GET /invoices/{id} Get invoice
InvoiceApi getInvoices GET /invoices Get invoices
IpAddressApi apiIpAddressesPost POST /ip-addresses Create IP address
IpAddressPoolApi apiIpAddressPoolsPost POST /ip-address-pools Creates a IpAddressPool resource.
LoginCheckApi loginCheckPost POST /auth/login Creates a user token.
NetworkApi attachNetworkToServer POST /cloud-servers/{id}/network Add network to server
NetworkApi createNetwork POST /cloud-networks Create network
NetworkApi deleteNetwork DELETE /cloud-networks/{id} Delete network
NetworkApi detachNetworkFromServer DELETE /cloud-servers/{id}/network/{networkId} Detach network from server
NetworkApi getNetwork GET /cloud-networks/{id} Get network
ObjectStorageApi getAccessKey GET /objects/access_keys/{id} Get an access key by id
ObjectStorageApi getAccessKeys GET /objects/access_keys Get the current access keys
ObjectStorageApi getBucket GET /objects/buckets/{id} Get a bucket by id
ObjectStorageApi getBuckets GET /objects/buckets Get the current buckets
PowerFeedApi getPowerFeed GET /power-feeds/{id} Get a power feed
RackApi getRack GET /racks/{id} Get a rack
RackApi getRacks GET /racks Get the racks
TicketApi createMessage POST /tickets/{id}/messages Create message
TicketApi createTicket POST /tickets Create ticket
TicketApi getTicket GET /tickets/{id} Get ticket
TicketApi getTickets GET /tickets Get tickets
TicketApi replyTicket POST /tickets/{id}/reply Reply to ticket
TrafficApi getBill GET /datacenter/traffic/bills/{id} Retrieves a Bill resource.
TrafficApi getBillHistories GET /datacenter/traffic/bills/{id}/history Retrieves the collection of BillHistory resources.
TrafficApi getBillHistory GET /datacenter/traffic/bills/{id}/history/{historyId} Retrieves a BillHistory resource.
TrafficApi getBillHistoryGraph GET /datacenter/traffic/bills/{id}/history/{historyId}/graphs/{graphType} Retrieves a Bill resource.
TrafficApi getBills GET /datacenter/traffic/bills Retrieves the collection of Bill resources.
UserApi completeUser POST /user/complete Complete the user registration
UserApi createApiToken POST /user/api-tokens Creates a ApiToken resource.
UserApi deleteApiToken DELETE /user/api-tokens/{id} Removes the ApiToken resource.
UserApi getApiTokens GET /user/api-tokens Retrieves the collection of ApiToken resources.
UserApi getLoginActivities GET /user/login-activities Retrieves the collection of LoginActivity resources.
UserApi getMe GET /user/me Get the current user
UserApi getUserCustomers GET /user/customers Get the customers of the current user
UserApi recoverPassword POST /auth/recover-password/{id} Recover the password
UserApi registerUser POST /auth/register Register a new user
UserApi requestPasswordRecovery POST /auth/request-password-recovery Request a password recovery
UserApi setDefaultCustomer POST /user/default-customer Set the default customer of the current user
UserApi testPasswordRecovery GET /auth/recover-password/{id} Test the password recovery token
VLANApi apiVlansGetCollection GET /vlans Retrieves the collection of VLAN resources.
VLANApi apiVlansIdGet GET /vlans/{id} Retrieves a VLAN resource.
VLANApi apiVlansPost POST /vlans Creates a VLAN resource.
WebspaceApi createWebspace POST /webspaces Create a webspace
WebspaceApi getWebspace GET /webspaces/{id} Get a webspace
WebspaceApi getWebspaces GET /webspaces Get all webspaces
WebspaceApi loginSessionWebspace POST /webspaces/{id}/login-session Login to a webspace
WebspacePlanApi apiWebspacePlansIdGet GET /webspace-plans/{id} Get webspace plan
ZoneApi createDnsZone POST /dns/zones Create a DNS zone
ZoneApi createDnsZoneRecord POST /dns/zones/{id}/records Create a DNS record
ZoneApi deleteDnsZone DELETE /dns/zones/{id} Delete a DNS zone
ZoneApi disableDnssec DELETE /dns/zones/{id}/dnssec Disable DNSSEC
ZoneApi enableDnssec POST /dns/zones/{id}/dnssec Enable DNSSEC
ZoneApi getDnsZone GET /dns/zones/{id} Get a DNS zone
ZoneApi getDnsZoneRecords GET /dns/zones/{id}/records Get a collection of DNS records
ZoneApi getDnsZones GET /dns/zones Get a collection of DNS zones
ZoneApi getDnssec GET /dns/zones/{id}/dnssec Get DNSSEC keys
ZoneApi updateDnsZone PUT /dns/zones/{id} Update a DNS zone
ZoneRecordApi deleteDnsZoneRecord DELETE /dns/zones/{id}/records/{recordId} Delete a DNS record
ZoneRecordApi updateDnsZoneRecord PUT /dns/zones/{id}/records/{recordId} Update a DNS record

Models

Authorization

Authentication schemes defined for the API:

JWT

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

info@netzfabrik.com

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 0.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen