Setting index values using the Portal
You can set index values using the portal
The
page enables buckets to be created and for index values to be assigned during the creation process.You can set metadata index values on a bucket using the ECS Portal or ECS Management REST API, or using the S3 protocol. The index values must reflect the name of the metadata that they are indexing and can be based on system metadata or user metadata.
A list of the available system metadata is provided in ECS System metadata and optional attributes.
Index values are set when a bucket is created. You can disable the use of indexing on a bucket, but you cannot change or delete individual index values.
You can set index values using the portal
The
page enables buckets to be created and for index values to be assigned during the creation process.You can set index values using the ECS Management REST API
API Path | Description |
---|---|
GET /object/bucket/searchmetadata | Lists the names of all system metadata keys available for assigning to a new bucket. |
POST /object/bucket | Assigns the metadata index names that are indexed for the specified bucket. The index names are supplied in the method payload. |
GET /object/bucket | Gets a list of buckets. The bucket information for each bucket shows the metadata search details. |
GET /object/bucket/{bucketname}/info | Gets the bucket details for the selected bucket. The information for the bucket includes the metadata search details. |
DELETE /object/bucket/{bucketname}/searchmetadata | Stops indexing using the metadata keys. |
The following example gets the entire list of metadata names available for indexing and that can be returned in queries.
s3curl.pl --id myuser -- http://{host}:9020/?searchmetadata
The results of the query are as follows.
<MetadataSearchList xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <IndexableKeys> <Key> <Name>LastModified</Name> <Datatype>datetime</Datatype> </Key> <Key> <Name>Owner</Name> <Datatype>string</Datatype> </Key> <Key> <Name>Size</Name> <Datatype>integer</Datatype> </Key> <Key> <Name>CreateTime</Name> <Datatype>datetime</Datatype> </Key> <Key> <Name>ObjectName</Name> <Datatype>string</Datatype> </Key> </IndexableKeys> <OptionalAttributes> <Attribute> <Name>ContentType</Name> <Datatype>string</Datatype> </Attribute> <Attribute> <Name>Expiration</Name> <Datatype>datetime</Datatype> </Attribute> <Attribute> <Name>ContentEncoding</Name> <Datatype>string</Datatype> </Attribute> <Attribute> <Name>Expires</Name> <Datatype>datetime</Datatype> </Attribute> <Attribute> <Name>Retention</Name> <Datatype>integer</Datatype> </Attribute> </OptionalAttributes> </MetadataSearchList>
The following example gets the list of metadata keys currently being indexed for a bucket.
s3curl.pl --id myuser -- http://{host}:9020/mybucket/?searchmetadata
The results of this example are as follows.
<MetadataSearchList xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <MetadataSearchEnabled>true</MetadataSearchEnabled> <IndexableKeys> <Key> <Name>Size</Name> <Datatype>integer</Datatype> </Key> <Key> <Name>x-amz-meta-DAT</Name> <Datatype>datetime</Datatype> </Key> </IndexableKeys> </MetadataSearchList>
The S3 API provides methods for working with indexes that are listed in the following table and links are provided to the API reference.
API Path | Description |
---|---|
GET /?searchmetadata | Lists the names of all system metadata available for indexing on new buckets. |
PUT /{bucket} -H x-emc-metadata-search: {name[;datatype],...} | Creates a bucket with the search metadata key that is indicated in the header.
NOTE: A datatype must be associated with a user metadata key, but is not necessary for a system metadata key.
|
GET /{bucket}/?searchmetadata | Gets the list of metadata keys that are currently being indexed for the bucket. |
The following example shows how to create a bucket with metadata indexes for three system metadata keys and two user metadata keys.
s3curl.pl --id myuser --createbucket -- http://{host}:9020/mybucket -H "x-emc-metadata-search:Size,CreateTime,LastModified,x-amz-meta-STR;String,x-amz-meta-INT;Integer"