Get Region of bucket

@param string $bucketName The bucket name.
@param mixed $options The optional bce configuration, which will overwrite the
default configuration that was passed while creating BosClient instance.
@return mixed
542472
public function getBucketLocation($bucketName, $options = array())
    {
        list($config) = $this->parseOptions($options, BosOptions::CONFIG);
        $response = $this->sendRequest(
            HttpMethod::GET,
            array(
                BosOptions::CONFIG => $config,
                'bucket_name' => $bucketName,
                'params' => array(
                    BosOptions::LOCATION => '',
                ),
            )
        );
        return $response->locationConstraint;
    }
858456
public function listBucketLiveChannels($bucket, $options = NULL)
    {
        $this->precheckCommon($bucket, NULL, $options, false);
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
        $options[self::OSS_OBJECT] = '/';
        $options[self::OSS_SUB_RESOURCE] = 'live';
        $options[self::OSS_QUERY_STRING] = array(
            'prefix' => isset($options['prefix']) ? $options['prefix'] : '',
            'marker' => isset($options['marker']) ? $options['marker'] : '',
            'max-keys' => isset($options['max-keys']) ? $options['max-keys'] : '',
        );
        $response = $this->auth($options);
        $result = new ListLiveChannelResult($response);
        $list = $result->getData();
        $list->setBucketName($bucket);

        return $list;
    }
536045
protected function getBucket()
    {
        if (empty($this->sS3Bucket)) {
            $this->sS3Bucket = $this->getRegionAndBucket()->bucket;
            if (empty($this->sS3Bucket)) {
                throw new DriverException('S3 Bucket has not been defined.');
            }
        }

        return $this->sS3Bucket;
    }
185486
private function getRegionZonesByTypeName($typeName)
    {
        return $this->getRegionZones()->filter(
            function($regionZone) use ($typeName) {
                return $regionZone->getType()->getName() === $typeName;
            }
        );
    }
463587
public function createBucket($bucket, $region='z0')
    {
        $bucket = \Qiniu\base64_urlSafeEncode($bucket);
        $path = "/mkbucketv2/".$bucket."/region/".$region;
        list(, $error) = $this->rsPost($path);
        return $error;
    }
1056994
public function canCallMethod($methodName, $options)
    {
        return (null !== ($options = $this->getMethodParameters($methodName, $options, false)));
    }
969434
public function deleteBucket(array $options)
    {
        if (!isset($options['BucketId']) && isset($options['BucketName'])) {
            $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']);
        }

        try {
            $this->generateAuthenticatedClient([
                'accountId' => $this->accountId,
                'bucketId'  => $options['BucketId'],
            ])->request('POST', $this->apiUrl.'/b2_delete_bucket');
        } catch (\Exception $e) {
            return false;
        }

        return true;
    }
1223408
public function getBucketWebsite($bucket, $options = NULL)
    {
        $this->precheckCommon($bucket, NULL, $options, false);
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
        $options[self::OSS_OBJECT] = '/';
        $options[self::OSS_SUB_RESOURCE] = 'website';
        $response = $this->auth($options);
        $result = new GetWebsiteResult($response);
        return $result->getData();
    }
348038
protected function getBucketRegion() {
		if(!$this->enabled()) {
			return false;
		}

		$config = [
			'version' => 'latest',
			'credentials' => [
				'key' => $this->key,
				'secret' => $this->secret
			]
		];

		if(!empty($this->endpoint)) {
			$config['endpoint'] = $this->endpoint;
			if($this->endPointPathStyle) {
				$config['use_path_style_endpoint'] = true;
			}
		}

		$s3 = new S3MultiRegionClient($config);
		$region = false;
		try {
			$region = $s3->determineBucketRegion($this->bucket);
		}
		catch(AwsException $ex) {
			Logger::error("AWS Error fetching region", ['exception' => $ex->getMessage()]);
		}

		return $region;
	}
1075859
public function createIndex($bucketName, $indexName, $columns, $condition = null, &$params = [], $options = [])
    {
        return $this->createCommand()->createIndex($bucketName, $indexName, $columns, $condition, $params, $options)->execute();
    }
620346
public function bucket_get_objects( $options = array() ) {
	 	
	 	$result = null;
	 	if( ! is_array( $options ) ) {
		
			$this->errors[$this->error_count] = 'options not given as array';
			$this->error_count++;
		
		}
		try {
		
			$result = $this->bucket->objects( $options );
		
		}
		catch( \Exception $e ) {
	
			$result = $e;
			$this->errors[$this->error_count] = $e->getServiceException()->getMessage();
			$this->error_count++;
		
		}
		return $result;		
		
	 }
317412
public static function getOptions($optionName = null)
    {
        $options = array();
        foreach (ini_get_all('session') as $sysOptionName => $sysOptionValues) {
            $options[substr($sysOptionName, 8)] = $sysOptionValues['local_value'];
        }
        foreach (self::$_localOptions as $localOptionName => $localOptionMemberName) {
            $options[$localOptionName] = self::${$localOptionMemberName};
        }

        if ($optionName) {
            if (array_key_exists($optionName, $options)) {
                return $options[$optionName];
            }
            return null;
        }

        return $options;
    }
50760
public function dropPrimaryIndex($bucketName)
    {
        $this->beginProfile($token = "    > drop index $bucketName ...");

        $result = $this->db->dropPrimaryIndex($bucketName);

        $this->endProfile($token);

        return $result;
    }
451698
protected static function getBitBucketClient(array $options = [])
    {
        if (null === static::$client || static::$client->getOptions() !== $options) {
            static::$client = new BitBucketClient($options);
        }

        return static::$client;
    }
817259
private function quoteBucketName($bucketName, &$params)
    {
        if (!is_array($bucketName)) {
            return $this->db->quoteBucketName($bucketName);
        }

        foreach ($bucketName as $i => $bucket) {
            if ($bucket instanceof Query) {
                list($sql, $params) = $this->build($bucket, $params);

                $bucketName[$i] = "($sql) " . $this->db->quoteBucketName($i);
            }
            elseif (is_string($i)) {
                if (strpos($bucket, '(') === false) {
                    $bucket = $this->db->quoteBucketName($bucket);
                }

                $bucketName[$i] = "$bucket " . $this->db->quoteBucketName($i);
            }
            elseif (strpos($bucket, '(') === false) {
                if (preg_match('/^(.*?)(?i:\s+as|)\s+([^ ]+)$/', $bucket, $matches)) { // with alias
                    $bucketName[$i] = $this->db->quoteBucketName($matches[1]) . ' ' . $this->db->quoteBucketName($matches[2]);
                }
                else {
                    $bucketName[$i] = $this->db->quoteBucketName($bucket);
                }
            }
        }

        return reset($bucketName);
    }
951334
public function getOption($optionName)
    {
        return (isset($this->service[$this->currentService]['options'][$optionName]))
            ? $this->service[$this->currentService]['options'][$optionName]
            : null;
    }
1213022
public function createBucket(array $options)
    {
        if (!in_array($options['BucketType'], [Bucket::TYPE_PUBLIC, Bucket::TYPE_PRIVATE])) {
            throw new ValidationException(
                sprintf('Bucket type must be %s or %s', Bucket::TYPE_PRIVATE, Bucket::TYPE_PUBLIC)
            );
        }

        $response = $this->client->request('POST', $this->apiUrl.'/b2_create_bucket', [
            'headers' => [
                'Authorization' => $this->authToken,
            ],
            'json' => [
                'accountId' => $this->accountId,
                'bucketName' => $options['BucketName'],
                'bucketType' => $options['BucketType']
            ]
        ]);

        return new Bucket($response['bucketId'], $response['bucketName'], $response['bucketType']);
    }