Create primary index.

@param string      $bucketName
@param string|null $indexName name of primary index (optional)
@param array       $options

@return bool
@throws Exception
@throws InvalidConfigException
549861
public function createPrimaryIndex($bucketName, $indexName = null, $options = [])
    {
        return $this->createCommand()->createPrimaryIndex($bucketName, $indexName, $options)->execute();
    }
1106116
public function createIndex($indexName)
    {
        $indexes = array_filter($this->mapProviders(function (SearchProviderInterface $provider) use ($indexName) {
            return $provider->createIndex($this->indexNamePrefix . $indexName);
        }));

        return reset($indexes);
    }
175140
public function createCollection($collectionName, array $options = [])
    {
        $this->document = $this->db->getQueryBuilder()->createCollection($collectionName, $options);

        $result = current($this->execute()->toArray());
        return $result['ok'] > 0;
    }
226016
public function createPrimaryIndex($bucketName, $indexName = null, $options = [])
    {
        $sql = $this->db->getQueryBuilder()->createPrimaryIndex($bucketName, $indexName, $options);

        return $this->setSql($sql)->setBucketName($bucketName);
    }
956108
public Acl createBucketAcl(String bucketName) {
    // [START createBucketAcl]
    Acl acl = storage.createAcl(bucketName, Acl.of(User.ofAllAuthenticatedUsers(), Role.READER));
    // [END createBucketAcl]
    return acl;
  }
1046422
public function doesObjectExist($bucket, $key, array $options = array())
    {
        try {
            $this->HeadObject(array(
                'Bucket' => $bucket,
                'Key' => $key));
            return True;
        }catch (\Exception $e){
            return False;
        }
    }
65394
public function updateBucket(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)
            );
        }

        if (!isset($options['BucketId']) && isset($options['BucketName'])) {
            $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']);
        }

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

        return new Bucket($response['bucketId'], $response['bucketName'], $response['bucketType']);
    }
1341566
public function buildIndex($bucketName, $indexNames)
    {
        $indexNames = is_array($indexNames) ? $indexNames : [$indexNames];

        foreach ($indexNames as $i => $indexName) {
            $indexNames[$i] = $this->db->quoteColumnName($indexName);
        }

        return 'BUILD INDEX ' . $this->db->quoteBucketName($bucketName) . '(' . implode(', ', $indexNames) . ') USING GSI';
    }
885871
public function getBucketAcl($bucketName, $options = array())
    {
        list($config) = $this->parseOptions($options, BosOptions::CONFIG);

        return $this->sendRequest(
            HttpMethod::GET,
            array(
                BosOptions::CONFIG => $config,
                'bucket_name' => $bucketName,
                'params' => array(
                    BosOptions::ACL => '',
                )
            )
        );
    }
805446
public function createIndex($tableName, $indexName, $indexSpec)
    {
        $this->query("ALTER TABLE \"$tableName\" ADD " . $this->getIndexSqlDefinition($indexName, $indexSpec));
    }
1329092
public function getIndex($indexName)
    {
        if (isset($this->indexes[$indexName])) {
            return $this->indexes[$indexName];
        }
        return null;
    }
1363607
public function updateBucket($name, array $options = [])
    {
        $buckets = $this->cbClusterManager->listBuckets();
        $bucketInfo = array_by_key_value($buckets, 'name', $name);
        $url = 'http://' . $this->host . array_get($bucketInfo, 'uri');
        $curlOptions = [
            CURLOPT_URL            => $url,
            CURLOPT_PORT           => $this->port,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_VERBOSE        => false,
            CURLOPT_POST           => true,
            CURLOPT_POSTFIELDS     => json_encode($options),
            CURLOPT_HTTPAUTH       => CURLAUTH_BASIC,
            CURLOPT_USERPWD        => $this->username . ":" . $this->password
        ];

        $ch = curl_init();
        curl_setopt_array($ch, $curlOptions);
        curl_exec($ch);
        $rs = curl_getinfo($ch);

        if (200 !== $code = array_get($rs, 'http_code')) {
            throw new InternalServerErrorException('Bucket update failed. Request received response code [' .
                $code .
                ']');
        }

        return true;
    }
388252
public function create($options = [])
    {
        $body = empty($options) ? $this->getDefaultIndexParams() : $options;

        self::getClient()->indices()->create(['index' => $this->getName(), 'body' => $body]);
    }
499695
public void createBucket(BucketConfiguration config) throws BucketAlreadyExistsException, IOException {
        if (!config.validate()) {
            throw new IllegalArgumentException("Invalid bucket configuration");
        }

        synchronized (buckets) {
            if (buckets.containsKey(config.name)) {
                throw new BucketAlreadyExistsException(config.name);
            }

            Bucket bucket = Bucket.create(this, config);
            BucketAdminServer adminServer = new BucketAdminServer(bucket, httpServer, this);
            adminServer.register();
            bucket.setAdminServer(adminServer);

            HttpAuthVerifier verifier = new HttpAuthVerifier(bucket, authenticator);

            if (config.type == BucketType.COUCHBASE) {
                CAPIServer capi = new CAPIServer(bucket, verifier);
                capi.register(httpServer);
                bucket.setCAPIServer(capi);
            }

            buckets.put(config.name, bucket);
            bucket.start();
        }
    }
599752
public function addBucketCname($bucket, $cname, $options = NULL)
    {
        $this->precheckCommon($bucket, NULL, $options, false);
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
        $options[self::OSS_OBJECT] = '/';
        $options[self::OSS_SUB_RESOURCE] = 'cname';
        $options[self::OSS_CONTENT_TYPE] = 'application/xml';
        $cnameConfig = new CnameConfig();
        $cnameConfig->addCname($cname);
        $options[self::OSS_CONTENT] = $cnameConfig->serializeToXml();
        $options[self::OSS_COMP] = 'add';

        $response = $this->auth($options);
        $result = new PutSetDeleteResult($response);
        return $result->getData();
    }
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();
    }
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;		
		
	 }