gogol-0.4.0: Comprehensive Google Services SDK.

Copyright(c) 2015-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.Google.Compute.Metadata

Contents

Description

Google Compute Engine defines a set of default metadata entries that provide information about your instance or project.

This module contains functions for retrieving various Compute metadata from an instance's local metadata endpoint using MonadIO, prior to initialisation of the environment used by the Network.Google monad.

Synopsis

Google Compute Instance Check

checkGCEVar :: String Source #

The NO_GCE_CHECK environment variable.

isGCE :: MonadIO m => Manager -> m Bool Source #

Detect if the underlying host is running on GCE.

The environment variable NO_GCE_CHECK can be set to 1, true, yes, or on to skip this check and always return False.

Retrieving Metadata

getProjectAttribute :: MonadIO m => Text -> Manager -> m (Maybe ByteString) Source #

A directory of custom metadata values that have been set for this project.

getSSHKeys :: MonadIO m => Manager -> m [Text] Source #

SSH keys that can connect to instances in the project. SSH keys for Compute Engine use a specialized format where the keys are prepended with a username, like so: user1:ssh-rsa my-public-ssh-key user1host.com@

getNumericProjectId :: MonadIO m => Manager -> m Text Source #

The numeric project ID of the instance, which is not the same as the project name visible in the Google Developers Console. This value is different from the project-id metadata entry value. The project-id value is required for all requests to the Compute Engine service.

getProjectId :: MonadIO m => Manager -> m Text Source #

The project ID.

getInstanceAttribute :: MonadIO m => Text -> Manager -> m (Maybe ByteString) Source #

A directory of custom metadata values passed to the instance during startup or shutdown.

getDescription :: MonadIO m => Manager -> m Text Source #

The free-text description of an instance, assigned using the --description flag, or set in the API.

getHostname :: MonadIO m => Manager -> m Text Source #

The host name of the instance.

getInstanceId :: MonadIO m => Manager -> m Text Source #

The ID of the instance. This is a unique, numerical ID that is generated by Google Compute Engine. This is useful for identifying instances if you do not want to use instance names.

getMachineType :: MonadIO m => Manager -> m Text Source #

The fully-qualified machine type name of the instance's host machine.

getTags :: MonadIO m => Manager -> m [Text] Source #

Any tags associated with the instance.

getZone :: MonadIO m => Manager -> m Text Source #

The instance's zone.

Raw Metadata Requests

metadataFlavorHeader :: HeaderName Source #

The Metadata-Flavor header.

metadataFlavorDesired :: ByteString Source #

The desired metadata flavor.

metadataRequest :: Request Source #

A default http-client Request with the host, port, and headers set appropriately for metadata.google.internal use.

getMetadata Source #

Arguments

:: MonadIO m 
=> ByteString

The request path.

-> [Int]

Acceptable status code responses.

-> Manager 
-> m (Response ByteString)