AwsRegion Class

(QtAws::Core::AwsRegion)

The AwsRegion class provides information about AWS regions. More...

Header: #include <AwsRegion>

Public Types

enum CardinalDirection { North, NorthNorthEast, NorthEast, EastNorthEast, ..., NortNorthWest }
enum MacroRegion { AsiaPacific, Europe, SouthAmerica, UnitedStates, UnitedStatesGov }
enum Region { InvalidRegion, AP_Northeast_1, AP_Southeast_1, AP_Southeast_2, ..., US_West_2 }
flags Regions

Public Functions

AwsRegion(const Region region)
AwsRegion(const QString &regionName)
~AwsRegion()
QString fullName() const
QString hostName(const QString &serviceName) const
bool isSupported(const QString &serviceName, const AwsEndpoint::Transports transports = AwsEndpoint::AnyTransport) const
bool isValid() const
QString name() const
Region region() const
QStringList supportedServices(const AwsEndpoint::Transports transports = AwsEndpoint::AnyTransport) const

Static Public Members

Region fromName(const QString &regionName)
QString fullName(const Region &region)
QString name(const Region &region)

Detailed Description

The AwsRegion class provides information about AWS regions.

Basic usage example:

const AwsRegion region(AwsRegion::AP_Northeast_1);
region.name();          // "ap-northeast-1"
region.fullName();      // "Asia Pacific (Tokyo) Region"
region.hostName("iam"); // "iam.amazonaws.com"

See also http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html.

Member Type Documentation

enum AwsRegion::CardinalDirection

This enum describes cardinal direction bit-flags for AWS regions.

ConstantValueDescription
QtAws::Core::AwsRegion::North0x00North.
QtAws::Core::AwsRegion::NorthNorthEast0x10North-north-east.
QtAws::Core::AwsRegion::NorthEast0x20North-east.
QtAws::Core::AwsRegion::EastNorthEast0x30East-north-east.
QtAws::Core::AwsRegion::East0x40East.
QtAws::Core::AwsRegion::EastSouthEast0x50East-south-east.
QtAws::Core::AwsRegion::SouthEast0x60South-east.
QtAws::Core::AwsRegion::SouthSouthEast0x70South-south-east.
QtAws::Core::AwsRegion::South0x80South.
QtAws::Core::AwsRegion::SouthSouthWest0x90South-sputh-west.
QtAws::Core::AwsRegion::SouthWest0xA0South-west.
QtAws::Core::AwsRegion::WestSouthWest0xB0West-south-west.
QtAws::Core::AwsRegion::West0xC0West.
QtAws::Core::AwsRegion::WestNorthWest0xD0West-north-west.
QtAws::Core::AwsRegion::NorthWest0xE0North-west.
QtAws::Core::AwsRegion::NortNorthWest0xF0Nort-north-west.

enum AwsRegion::MacroRegion

This enum describes macro region bit-flags for AWS regions.

ConstantValueDescription
QtAws::Core::AwsRegion::AsiaPacific0x100Asia-Pacific.
QtAws::Core::AwsRegion::Europe0x300Europe.
QtAws::Core::AwsRegion::SouthAmerica0xA00South America.
QtAws::Core::AwsRegion::UnitedStates0xB00United States of America.
QtAws::Core::AwsRegion::UnitedStatesGov0xC00United States Government.

enum AwsRegion::Region
flags AwsRegion::Regions

This enum describes the available AWS regions.

ConstantValueDescription
QtAws::Core::AwsRegion::InvalidRegion0Not a valid AWS region.
QtAws::Core::AwsRegion::AP_Northeast_1AsiaPacific + NorthEast + 0x1Asia Pacific (Tokyo) Region.
QtAws::Core::AwsRegion::AP_Southeast_1AsiaPacific + SouthEast + 0x1Asia Pacific (Singapore) Region.
QtAws::Core::AwsRegion::AP_Southeast_2AsiaPacific + SouthEast + 0x2Asia Pacific (Sydney) Region.
QtAws::Core::AwsRegion::EU_West_1Europe + West + 0x1EU (Ireland) Region.
QtAws::Core::AwsRegion::SA_East_1SouthAmerica + East + 0x1São Paulo Region.
QtAws::Core::AwsRegion::US_East_1UnitedStates + East + 0x1US East (Northern Virginia) Region.
QtAws::Core::AwsRegion::US_Gov_West_1UnitedStatesGov + West + 0x1AWS GovCloud (US) Region.
QtAws::Core::AwsRegion::US_West_1UnitedStates + West + 0x1US West (Northern California) Region.
QtAws::Core::AwsRegion::US_West_2UnitedStates + West + 0x2US West (Oregon) Region.

The Regions type is a typedef for QFlags<Region>. It stores an OR combination of Region values.

Member Function Documentation

AwsRegion::AwsRegion(const Region region)

Constructs an AwsRegion object for AWS region.

AwsRegion::AwsRegion(const QString &regionName)

Constructs an AwsRegion object for AWS regionName.

If regionName is not recognised as a valid AWS region, isValid() will return false.

AwsRegion::~AwsRegion()

Destroys the AWS region.

[static] Region AwsRegion::fromName(const QString &regionName)

Returns the AwsRegion::Region enum value for regionName, or InvalidRegion if not a valid region name.

regionName is not case sensitive.

QString AwsRegion::fullName() const

Returns the full name for this AWS region.

This returns a humand-readable name for this object's region. For example, for the AwsRegion::US_East_1 region, this will return something like "US East (Northern Virginia) Region".

These full names were gleaned from http://aws.amazon.com/about-aws/globalinfrastructure/ and http://docs.aws.amazon.com/general/latest/gr/rande.html.

[static] QString AwsRegion::fullName(const Region &region)

Returns the full name for AWS region.

This returns a humand-readable name for the specified AWS region. For example, for the AwsRegion::US_East_1 region, this will return something like "US East (Northern Virginia) Region".

These full names were gleaned from http://aws.amazon.com/about-aws/globalinfrastructure/ and http://docs.aws.amazon.com/general/latest/gr/rande.html.

QString AwsRegion::hostName(const QString &serviceName) const

Returns the name of the host that supports serviceName for this region, or a null string if the service is not supported for this region.

bool AwsRegion::isSupported(const QString &serviceName, const AwsEndpoint::Transports transports = AwsEndpoint::AnyTransport) const

Returns true if serviceName is supported for this region, for at least one of the specified transports; false otherwise.

bool AwsRegion::isValid() const

Returns true if this region is valid; false otherwise.

Any AwsRegion object created using one of the valid AwsRegion::Region enumeration values (ie any but AwsRegion::InvalidRegion) will be considered valid.

However, if an unknown region name is supplied to the overloaded AwsRegion(const QString &regionName) constructor, then the constructed object will be considered invalid.

QString AwsRegion::name() const

Returns the canonical AWS name for this region, or a null string if invalid.

See also isValid.

[static] QString AwsRegion::name(const Region &region)

Returns the canonical AWS name for region.

Region AwsRegion::region() const

Returns the region as an AwsRegion::Region enum, or AwsRegion::InvalidRegion if the region is invalid.

If this object was given an AwsRegion::Region value during construction, this function will simply return that enumeration value.

If this object was constructed from an AWS region name, then this function will return the AwsRegion::Region enumeration value corresponding to that AWS region name, or AwsRegion::InvalidRegion if the given region name did not name a known, valid AWS region.

QStringList AwsRegion::supportedServices(const AwsEndpoint::Transports transports = AwsEndpoint::AnyTransport) const

Returns the list of the names of all AWS services support by this region for at least one of the specified transports. The list may be empty.

© 2018 Paul Colby Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.