2017 © Pedro Peláez
 

library gcp-metadata

Get the metadata from a Google Cloud Platform environment.

image

kreait/gcp-metadata

Get the metadata from a Google Cloud Platform environment.

  • Saturday, July 28, 2018
  • by jeromegamez
  • Repository
  • 2 Watchers
  • 0 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

GCP Metadata

Get the metadata from a Google Cloud Platform environment., (*1)

Current version Supported PHP version GitHub license Unit Tests Sponsor, (*2)

$ composer install kreait/gcp-metadata
use Kreait\GcpMetadata;

$metadata = new GcpMetadata();

Check if the metadata server is available

$isAvailable = $metadata->isAvailable();

Get all available instance properties

$data = $metadata->instance();

Get all available project properties

$data = $metadata->project();

Access a specific property

$data = $metadata->instance('hostname');

Wrap queries in a try/catch block if you don't check for availability

use Kreait\GcpMetadata;

$metadata = new GcpMetadata();

if ($metadata->isAvailable()) {
    echo $metadata->instance('hostname');
}

try {
    echo $metadata->instance('hostname');   
} catch (GcpMetadata\Error $e) {
    echo $e->getMessage();
}

The Versions

28/07 2018

dev-master

9999999-dev

Get the metadata from a Google Cloud Platform environment.

  Sources   Download

MIT

The Requires

 

The Development Requires

google gcp gce google-cloud google-cloud-engine google-cloud-platform

28/07 2018

1.0.1

1.0.1.0

Get the metadata from a Google Cloud Platform environment.

  Sources   Download

MIT

The Requires

 

The Development Requires

google gcp gce google-cloud google-cloud-engine google-cloud-platform

27/07 2018

1.0

1.0.0.0

Get the metadata from a Google Cloud Platform environment.

  Sources   Download

MIT

The Requires

 

The Development Requires

google gcp gce google-cloud google-cloud-engine google-cloud-platform