bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
cmr::CmrApi Class Reference
Collaboration diagram for cmr::CmrApi:
Collaboration graph

Public Member Functions

void get_collection_ids (std::vector< std::string > &collection_ids) const
 
void get_collections (const std::string &provider_id, std::map< std::string, std::unique_ptr< cmr::Collection > > &collections) const
 
void get_days (const std::string &collection_name, const std::string &r_year, const std::string &r_month, std::vector< std::string > &days_result) const
 
std::unique_ptr< Granuleget_granule (const std::string &collection_name, const std::string &r_year, const std::string &r_month, const std::string &r_day, const std::string &granule_id) const
 
cmr::Granuleget_granule (const std::string path) const
 
void get_granule_ids (const std::string &collection_name, const std::string &r_year, const std::string &r_month, const std::string &r_day, std::vector< std::string > &granule_ids) const
 
void get_granules (const std::string &collection_name, const std::string &r_year, const std::string &r_month, const std::string &r_day, std::vector< std::unique_ptr< cmr::Granule > > &granule_objs) const
 
void get_granules_umm (const std::string &collection_name, const std::string &r_year, const std::string &r_month, const std::string &r_day, std::vector< std::unique_ptr< cmr::GranuleUMM > > &granule_objs) const
 
void get_months (const std::string &collection_name, const std::string &year, std::vector< std::string > &months_result) const
 
void get_opendap_collections (const std::string &provider_id, std::map< std::string, std::unique_ptr< cmr::Collection > > &collections) const
 
unsigned long int get_opendap_collections_count (const std::string &provider_id) const
 
void get_opendap_providers (std::map< std::string, std::unique_ptr< cmr::Provider > > &providers) const
 
void get_providers (std::vector< std::unique_ptr< cmr::Provider > > &providers) const
 
const nlohmann::json & get_related_urls_array (const nlohmann::json &go) const
 
void get_years (const std::string &collection_name, std::vector< std::string > &years_result) const
 
unsigned long granule_count (const std::string &collection_name, const std::string &r_year, const std::string &r_month, const std::string &r_day) const
 

Detailed Description

Definition at line 53 of file CmrApi.h.

Constructor & Destructor Documentation

◆ CmrApi()

cmr::CmrApi::CmrApi ( )

Definition at line 68 of file CmrApi.cc.

Member Function Documentation

◆ get_collection_ids()

void cmr::CmrApi::get_collection_ids ( std::vector< std::string > & collection_ids) const

Definition at line 723 of file CmrApi.cc.

◆ get_collections()

void cmr::CmrApi::get_collections ( const std::string & provider_id,
std::map< std::string, std::unique_ptr< cmr::Collection > > & collections ) const

Definition at line 895 of file CmrApi.cc.

◆ get_days()

void cmr::CmrApi::get_days ( const std::string & collection_name,
const std::string & r_year,
const std::string & r_month,
std::vector< std::string > & days_result ) const
Parameters
collection_concept_id
r_year
r_month
days_result

Definition at line 518 of file CmrApi.cc.

◆ get_granule()

unique_ptr< Granule > cmr::CmrApi::get_granule ( const std::string & collection_name,
const std::string & r_year,
const std::string & r_month,
const std::string & r_day,
const std::string & granule_id ) const

Returns the requested granule by searching the collection at the supplied date and sifting the result.

Parameters
collection_name
r_year
r_month
r_day
granule_id
Returns

Definition at line 745 of file CmrApi.cc.

◆ get_granule_ids()

void cmr::CmrApi::get_granule_ids ( const std::string & collection_name,
const std::string & r_year,
const std::string & r_month,
const std::string & r_day,
std::vector< std::string > & granule_ids ) const
Parameters
collection_name
r_year
r_month
r_day
granule_ids

Definition at line 561 of file CmrApi.cc.

◆ get_granules()

void cmr::CmrApi::get_granules ( const std::string & collection_name,
const std::string & r_year,
const std::string & r_month,
const std::string & r_day,
std::vector< std::unique_ptr< cmr::Granule > > & granule_objs ) const

Returns all of the Granules in the collection matching the date.

Definition at line 680 of file CmrApi.cc.

◆ get_granules_umm()

void cmr::CmrApi::get_granules_umm ( const std::string & collection_name,
const std::string & r_year,
const std::string & r_month,
const std::string & r_day,
std::vector< std::unique_ptr< cmr::GranuleUMM > > & granule_objs ) const

Returns all of the GranuleUMMs in the collection matching the date.

Definition at line 702 of file CmrApi.cc.

◆ get_months()

void cmr::CmrApi::get_months ( const std::string & collection_name,
const std::string & year,
std::vector< std::string > & months_result ) const

Queries CMR for the 'collection_name' and returns the span of years covered by the collection.

https://cmr.earthdata.nasa.gov/search/granules.json?concept_id=C179003030-ORNL_DAAC&include_facets=v2&temporal_facet%5B0%5D%5Byear%5D=1985

Parameters
collection_nameThe name of the collection to query.
collection_yearsA vector into which the years will be placed.

Definition at line 449 of file CmrApi.cc.

◆ get_opendap_collections()

void cmr::CmrApi::get_opendap_collections ( const std::string & provider_id,
std::map< std::string, std::unique_ptr< cmr::Collection > > & collections ) const

Definition at line 891 of file CmrApi.cc.

◆ get_opendap_collections_count()

unsigned long int cmr::CmrApi::get_opendap_collections_count ( const std::string & provider_id) const

Determines the number of collections published by the "provider" that are tagged as having an opendap URL The collections search endpoint query uses the provider_id and the query parameter "has_opendap_url=true" to acheive this.

Parameters
provider_id
Returns

Definition at line 825 of file CmrApi.cc.

◆ get_opendap_providers()

void cmr::CmrApi::get_opendap_providers ( std::map< std::string, std::unique_ptr< cmr::Provider > > & providers) const

Gets the list of all of the providers and then weeds out the ones that have no collections with OPeNDAP data access URLs

Parameters
opendap_providers

Definition at line 803 of file CmrApi.cc.

◆ get_providers()

void cmr::CmrApi::get_providers ( std::vector< std::unique_ptr< cmr::Provider > > & providers) const

Uses the "new" CMR providers API to retrieve all of the Providers information using, specifically, the <cmr_host>/search/providers endpoint and NOT the <cmr_host>/ingest/providers endpoint. This is because the ingest/providers endpoint returns a metadata free list of the providers, and then to get the metadata for each provider a separate HTTP request must be made.

The <cmr_host>/search/providers endpoint returns the metadata for all of the providers, so a single HTTP request

Parameters
providersThe vector into which each Providers unique_ptr object will be placed.

Definition at line 777 of file CmrApi.cc.

◆ get_related_urls_array()

const nlohmann::json & cmr::CmrApi::get_related_urls_array ( const nlohmann::json & json_obj) const

Internal method that retrieves the "links" array from the Granule's object.

Definition at line 101 of file CmrApi.cc.

◆ granule_count()

unsigned long cmr::CmrApi::granule_count ( const std::string & collection_name,
const std::string & r_year,
const std::string & r_month,
const std::string & r_day ) const
Parameters
collection_name
r_year
r_month
r_day
Returns

Definition at line 589 of file CmrApi.cc.


The documentation for this class was generated from the following files: