describe_domains ( $opt )

Gets information about the search domains owned by this account. Can be limited to specific domains. Shows all domains by default.

Access

public

Parameters

Parameter

Type

Required

Description

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • DomainNames - string|array - Optional - Limits the DescribeDomains response to the specified search domains. Pass a string for a single value, or an indexed array for multiple values.
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Create and delete a search domain.

// Instantiate the class
$search = new AmazonCloudSearch();

$domain_name = 'my-domain';

/*%**************************************************************%*/
// Create a new CloudSearch domain

echo '# Creating a new CloudSearch domain' . PHP_EOL;
$response = $search->create_domain($domain_name);

// Check for success...
if ($response->isOK())
{
	echo 'Kicked off the creation of the CloudSearch domain...' . PHP_EOL;
}
else
{
	print_r($response);
}

echo PHP_EOL;

/*%**************************************************************%*/
// Describe the CloudSearch domains

echo "# Describing the CloudSearch domain, \"${domain_name}\"" . PHP_EOL;
$response = $search->describe_domains(array(
	'DomainNames' => $domain_name
));

print_r($response->body->Arn()->map_string());

echo PHP_EOL;

/*%**************************************************************%*/
// Delete the CloudSearch domain

echo '# Deleting the CloudSearch domain...' . PHP_EOL;
$response = $search->delete_domain($domain_name);

// Check for success...
if ($response->isOK())
{
	echo 'CloudSearch domain was deleted successfully.' . PHP_EOL;
}
else
{
	print_r($response);
}

Source

Method defined in services/cloudsearch.class.php | Toggle source view (15 lines) | View on GitHub

public function describe_domains($opt = null)
{
    if (!$opt) $opt = array();
            
    // Optional list (non-map)
    if (isset($opt['DomainNames']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'DomainNames' => (is_array($opt['DomainNames']) ? $opt['DomainNames'] : array($opt['DomainNames']))
        ), 'member'));
        unset($opt['DomainNames']);
    }

    return $this->authenticate('DescribeDomains', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback