A remote endpoint using AWS's S3 protocol.  
 More...
#include <remote_handle.hpp>
 | 
|   | S3Endpoint (std::string url, std::optional< std::string > aws_region=std::nullopt, std::optional< std::string > aws_access_key=std::nullopt, std::optional< std::string > aws_secret_access_key=std::nullopt, std::optional< std::string > aws_session_token=std::nullopt) | 
|   | Create a S3 endpoint from a url.  More...
  | 
|   | 
|   | S3Endpoint (std::pair< std::string, std::string > bucket_and_object_names, std::optional< std::string > aws_region=std::nullopt, std::optional< std::string > aws_access_key=std::nullopt, std::optional< std::string > aws_secret_access_key=std::nullopt, std::optional< std::string > aws_endpoint_url=std::nullopt, std::optional< std::string > aws_session_token=std::nullopt) | 
|   | Create a S3 endpoint from a bucket and object name.  More...
  | 
|   | 
| void  | setopt (CurlHandle &curl) override | 
|   | Set needed connection options on a curl handle.  More...
  | 
|   | 
| std::string  | str () const override | 
|   | Get a description of this remote point instance.  More...
  | 
|   | 
 | 
| static std::string  | url_from_bucket_and_object (std::string bucket_name, std::string object_name, std::optional< std::string > aws_region, std::optional< std::string > aws_endpoint_url) | 
|   | Get url from a AWS S3 bucket and object name.  More...
  | 
|   | 
| static std::pair< std::string, std::string >  | parse_s3_url (std::string const &s3_url) | 
|   | Given an url like "s3://<bucket>/<object>", return the name of the bucket and object.  More...
  | 
|   | 
A remote endpoint using AWS's S3 protocol. 
Definition at line 92 of file remote_handle.hpp.
 
◆ S3Endpoint() [1/2]
      
        
          | kvikio::S3Endpoint::S3Endpoint  | 
          ( | 
          std::string  | 
          url,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_region = std::nullopt,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_access_key = std::nullopt,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_secret_access_key = std::nullopt,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_session_token = std::nullopt  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Create a S3 endpoint from a url. 
- Parameters
 - 
  
    | url | The full http url to the S3 file. NB: this should be an url starting with "http://" or "https://". If you have an S3 url of the form "s3://<bucket>/<object>", please use S3Endpoint::parse_s3_url() and `S3Endpoint::url_from_bucket_and_object() to convert it.  | 
    | aws_region | The AWS region, such as "us-east-1", to use. If nullopt, the value of the AWS_DEFAULT_REGION environment variable is used.  | 
    | aws_access_key | The AWS access key to use. If nullopt, the value of the AWS_ACCESS_KEY_ID environment variable is used.  | 
    | aws_secret_access_key | The AWS secret access key to use. If nullopt, the value of the AWS_SECRET_ACCESS_KEY environment variable is used.  | 
    | aws_session_token | The AWS session token to use. If nullopt, the value of the AWS_SESSION_TOKEN environment variable is used.  | 
  
   
 
 
◆ S3Endpoint() [2/2]
      
        
          | kvikio::S3Endpoint::S3Endpoint  | 
          ( | 
          std::pair< std::string, std::string >  | 
          bucket_and_object_names,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_region = std::nullopt,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_access_key = std::nullopt,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_secret_access_key = std::nullopt,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_endpoint_url = std::nullopt,  | 
        
        
           | 
           | 
          std::optional< std::string >  | 
          aws_session_token = std::nullopt  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Create a S3 endpoint from a bucket and object name. 
- Parameters
 - 
  
    | bucket_and_object_names | The bucket and object names of the S3 bucket.  | 
    | aws_region | The AWS region, such as "us-east-1", to use. If nullopt, the value of the AWS_DEFAULT_REGION environment variable is used.  | 
    | aws_access_key | The AWS access key to use. If nullopt, the value of the AWS_ACCESS_KEY_ID environment variable is used.  | 
    | aws_secret_access_key | The AWS secret access key to use. If nullopt, the value of the AWS_SECRET_ACCESS_KEY environment variable is used.  | 
    | aws_endpoint_url | Overwrite the endpoint url (including the protocol part) by using the scheme: "<aws_endpoint_url>/<bucket_name>/<object_name>". If nullopt, the value of the AWS_ENDPOINT_URL environment variable is used. If this is also not set, the regular AWS url scheme is used: "https://<bucket_name>.s3.<region>.amazonaws.com/<object_name>".  | 
    | aws_session_token | The AWS session token to use. If nullopt, the value of the AWS_SESSION_TOKEN environment variable is used.  | 
  
   
 
 
◆ parse_s3_url()
  
  
      
        
          | static std::pair<std::string, std::string> kvikio::S3Endpoint::parse_s3_url  | 
          ( | 
          std::string const &  | 
          s3_url | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Given an url like "s3://<bucket>/<object>", return the name of the bucket and object. 
- Exceptions
 - 
  
    | std::invalid_argument | if url is ill-formed or is missing the bucket or object name. | 
  
   
- Parameters
 - 
  
  
 
- Returns
 - Pair of strings: [bucket-name, object-name]. 
 
 
 
◆ setopt()
  
  
      
        
          | void kvikio::S3Endpoint::setopt  | 
          ( | 
          CurlHandle &  | 
          curl | ) | 
           | 
         
       
   | 
  
overridevirtual   | 
  
 
Set needed connection options on a curl handle. 
Subsequently, a call to curl.perform() should connect to the endpoint.
- Parameters
 - 
  
  
 
Implements kvikio::RemoteEndpoint.
 
 
◆ str()
  
  
      
        
          | std::string kvikio::S3Endpoint::str  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
overridevirtual   | 
  
 
Get a description of this remote point instance. 
- Returns
 - A string description. 
 
Implements kvikio::RemoteEndpoint.
 
 
◆ url_from_bucket_and_object()
  
  
      
        
          | static std::string kvikio::S3Endpoint::url_from_bucket_and_object  | 
          ( | 
          std::string  | 
          bucket_name,  | 
         
        
           | 
           | 
          std::string  | 
          object_name,  | 
         
        
           | 
           | 
          std::optional< std::string >  | 
          aws_region,  | 
         
        
           | 
           | 
          std::optional< std::string >  | 
          aws_endpoint_url  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Get url from a AWS S3 bucket and object name. 
- Exceptions
 - 
  
    | std::invalid_argument | if no region is specified and no default region is specified in the environment. | 
  
   
- Parameters
 - 
  
    | bucket_name | The name of the S3 bucket.  | 
    | object_name | The name of the S3 object.  | 
    | aws_region | The AWS region, such as "us-east-1", to use. If nullopt, the value of the AWS_DEFAULT_REGION environment variable is used.  | 
    | aws_endpoint_url | Overwrite the endpoint url (including the protocol part) by using the scheme: "<aws_endpoint_url>/<bucket_name>/<object_name>". If nullopt, the value of the AWS_ENDPOINT_URL environment variable is used. If this is also not set, the regular AWS url scheme is used: "https://<bucket_name>.s3.<region>.amazonaws.com/<object_name>".  | 
  
   
 
 
The documentation for this class was generated from the following file: