Giter VIP home page Giter VIP logo

acquia-php-sdk-v2's Introduction

Acquia PHP SDK for CloudAPI v2

Build Status Total Downloads Coverage Status Quality Status

License Latest Stable Version Latest Unstable Version

This library provides the capability to develop tooling which integrates with the new version (2.0) of Cloud API.

The original Acquia Cloud SDK has been deprecated so build tools requiring modern PHP versions and packages should use this library.

Installation

The SDK can be installed with Composer by adding this library as a dependency to your composer.json file.

{
    "require": {
        "typhonius/acquia-php-sdk-v2": "^2.0.0"
    }
}

Generating an API access token

To generate an API access token, login to https://cloud.acquia.com, then visit https://cloud.acquia.com/#/profile/tokens, and click Create Token.

  • Provide a label for the access token, so it can be easily identified. Click Create Token.
  • The token has been generated, copy the api key and api secret to a secure place. Make sure you record it now: you will not be able to retrieve this access token's secret again.

Usage

Basic usage examples for the SDK.

<?php

require 'vendor/autoload.php';

use AcquiaCloudApi\Connector\Client;
use AcquiaCloudApi\Connector\Connector;
use AcquiaCloudApi\Endpoints\Applications;
use AcquiaCloudApi\Endpoints\Environments;
use AcquiaCloudApi\Endpoints\Servers;
use AcquiaCloudApi\Endpoints\DatabaseBackups;

$key = 'd0697bfc-7f56-4942-9205-b5686bf5b3f5';
$secret = 'D5UfO/4FfNBWn4+0cUwpLOoFzfP7Qqib4AoY+wYGsKE=';

$config = [
    'key' => $key,
    'secret' => $secret,
];

$connector = new Connector($config);
$client = Client::factory($connector);

$application = new Applications($client);
$environment = new Environments($client);
$server      = new Servers($client);
$backup      = new DatabaseBackups($client);

// Get all applications.
$applications = $application->getAll();

// Get all environments of an application.
$environments = $environment->getAll($applicationUuid);

// Get all servers in an environment.
$servers = $server->getAll($environmentUuid);

// Create DB backup
$backup->create($environmentUuid, $dbName);

Documentation

Documentation of each of the classes and methods has been automatically generated by phpDocumentor and exists in the gh-pages branch. This is available for browsing on GitHub.

I just want to talk to the API without having to write code

The Acquia Cli Robo application creates a command line tool for communicating with the API using this SDK. Its purpose is to provide a simple mechanism for interacting with the API without having to write a line of code.

acquia-php-sdk-v2's People

Contributors

cb-paryank avatar eporama avatar grasmash avatar jayakrishnanj avatar q0rban avatar rujiali avatar solocal-ecommerce avatar timmillwood avatar typhonius avatar violinist-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.