Beispiel #1
0
 def __init__(self,
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs) -> None:
     """
     Instanciate the segmentation API methods class-
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     """
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = aepp.config.endpoints[
         "global"] + aepp.config.endpoints["segmentation"]
     self.SCHEDULE_TEMPLATE = {
         "name": "profile-default",
         "type": "batch_segmentation-OR-export",
         "properties": {
             "segments": ["*"]
         },
         "schedule": "0 0 1 * * ?",
         "state": "inactive"
     }
Beispiel #2
0
 def __init__(self,config:dict=aepp.config.config_object,header=aepp.config.header, **kwargs):
     """
     initialize the Flow Service instance.
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     """
     self.connector = connector.AdobeRequest(config_object=config, header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = aepp.config.endpoints["global"] + aepp.config.endpoints["flow"]
Beispiel #3
0
 def __init__(self,config:dict=aepp.config.config_object,header=aepp.config.header, **kwargs):
     """
     Instantiate the class to manage DULE rules and statement directly.
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     """
     self.connector = connector.AdobeRequest(config_object=config, header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = aepp.config.endpoints["global"]+aepp.config.endpoints["policy"]
Beispiel #4
0
 def __init__(self,
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs):
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = aepp.config.endpoints[
         'global'] + aepp.config.endpoints["catalog"]
     self.data = _Data()
 def __init__(self,config:dict=aepp.config.config_object,header=aepp.config.header, **kwargs):
     """
     This will instantiate the profile class 
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
 kwargs:
     kwargsvaluewillupdatetheheader
     """
     self.connector = connector.AdobeRequest(config_object=config, header=header)
     self.header = self.connector.header
     self.header['Accept'] = "application/vnd.adobe.xdm+json"
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     # same endpoint than segmentation
     self.endpoint = aepp.config.endpoints['global']+aepp.config.endpoints["segmentation"]
Beispiel #6
0
def home(product: str = None, limit: int = 50):
    """
    Return the IMS Organization setup and the container existing for the organization
    Arguments:
        product : OPTIONAL : specify one or more product contexts for which to return containers. If absent, containers for all contexts that you have rights to will be returned. The product parameter can be repeated for multiple contexts. An example of this parameter is product=acp
        limit : OPTIONAL : Optional limit on number of results returned (default = 50).
    """
    global connection
    connection = connector.AdobeRequest(config_object=config.config_object,
                                        header=config.header)
    endpoint = config.endpoints['global'] + "/data/core/xcore/"
    params = {"product": product, "limit": limit}
    myHeader = deepcopy(connection.header)
    myHeader["Accept"] = "application/vnd.adobe.platform.xcore.home.hal+json"
    res = connection.getData(endpoint, params=params, headers=myHeader)
    return res
Beispiel #7
0
 def __init__(self,
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs):
     """
     Instantiate the sandbox class.
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     Additional kwargs will update the header.
     """
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.endpoint = aepp.config.endpoints[
         "global"] + aepp.config.endpoints["sandboxes"]
Beispiel #8
0
 def __init__(self,config:dict=aepp.config.config_object,header=aepp.config.header, **kwargs)->None:
     """
     Instanciate the observability API methods class.
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     """
     self.connector = connector.AdobeRequest(config_object=config, header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = aepp.config.endpoints["global"]+aepp.config.endpoints["observability"]
     self.POST_METRICS={
                         "start": "2020-07-14T00:00:00.000Z",
                         "end": "2020-07-22T00:00:00.000Z",
                         "granularity": "day",
                         "metrics": [
                             {
                             "name": "timeseries.ingestion.dataset.recordsuccess.count",
                             "filters": [
                                 {
                                 "name": "dataSetId",
                                 "value": "5edcfb2fbb642119194c7d94|5eddb21420f516191b7a8dad",
                                 "groupBy": True
                                 }
                             ],
                             "aggregator": "sum",
                             "downsample": "sum"
                             },
                             {
                             "name": "timeseries.ingestion.dataset.dailysize",
                             "filters": [
                                 {
                                 "name": "dataSetId",
                                 "value": "5eddb21420f516191b7a8dad",
                                 "groupBy": False
                                 }
                             ],
                             "aggregator": "sum",
                             "downsample": "sum"
                             }
                         ]
                         }
     self._loadREFERENCES()
Beispiel #9
0
 def __init__(self,
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs) -> None:
     """
     Instantiate the access controle API wrapper.
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     kwargs : 
         header options
     """
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header)
     self.sandbox = self.connector.config['sandbox']
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.endpoint = aepp.config.endpoints[
         'global'] + aepp.config.endpoints["access"]
Beispiel #10
0
 def __init__(self,
              config_object: dict = config.config_object,
              header=config.header,
              **kwargs) -> None:
     """
     Instanciate the class for Query Service call.
     Arguments:
         config_object : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     kwargs:
         kwargs will update the header
     """
     self.connector = connector.AdobeRequest(config_object=config_object,
                                             header=header)
     self.header = self.connector.header
     #self.header.update({"Accept": "application/json"})
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = config.endpoints["global"] + config.endpoints["query"]
Beispiel #11
0
 def __init__(self,config:dict=aepp.config.config_object,header=aepp.config.header, **kwargs)->None:
     """
     This will instantiate the Mapping class 
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
 kwargs:
     kwargs value will update the header
     """
     self.connector = connector.AdobeRequest(config_object=config, header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     # same endpoint than segmentation
     self.endpoint = aepp.config.endpoints['global']+aepp.config.endpoints["mapping"]
     self.REFERENCE_MAPPING = {
         "sourceType": "",
         "source": "",
         "destination": ""
     }
Beispiel #12
0
 def __init__(self,
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs) -> None:
     """
     Initialize the class with the config header used.
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     Additional kwargs will update the header.
     """
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header)
     self.header = self.connector.header
     self.header[
         'Accept'] = "application/vnd.adobe.platform.sensei+json;profile=mlInstanceListing.v1.json"
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = aepp.config.endpoints[
         "global"] + aepp.config.endpoints["sensei"]
Beispiel #13
0
 def __init__(self,
              region: str = "nld2",
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs):
     """
     Require a region.
     By default, the NLD2 will be selected. (other choice : va7)
     Additional kwargs will update the header.
     more info : https://docs.adobe.com/content/help/en/experience-platform/identity/api/getting-started.html
     Arguments:
         region : REQUIRED : either nld2 or va7
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     """
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = f"https://platform-{region}.adobe.io" + \
         aepp.config.endpoints["identity"]
Beispiel #14
0
 def __init__(self,
              containerId: str = "tenant",
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs):
     """
     Copy the token and header and initiate the object to retrieve schema elements.
     Arguments:
         containerId : OPTIONAL : "tenant"(default) or "global"
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module. 
     possible kwargs:
         x-sandbox-name : name of the sandbox you want to use (default : "prod").
     """
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header)
     self.header = self.connector.header
     self.header['Accept'] = "application/vnd.adobe.xdm+json"
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = aepp.config.endpoints[
         "global"] + aepp.config.endpoints["schemas"]
     self.container = containerId
     self.data = _Data()
 def __init__(self,
              privacyScope: bool = True,
              aepScope: bool = False,
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs) -> None:
     """
     Instanciate the class for Privacy Service call.
     Arguments:
         privacyScope : OPTIONAL : set the connection retrieved process with the Privacy JWT scope (default True).
         aepScope : OPTIONAL : set the connection retrieved process with the AEP JWT scope if set to True (default False).
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     kwargs:
         kwargs will update the header
     """
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header,
                                             aepScope=aepScope,
                                             privacyScope=privacyScope)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.endpoint = aepp.config.endpoints[
         "global"] + aepp.config.endpoints["privacy"]
Beispiel #16
0
 def __init__(self,
              config: dict = aepp.config.config_object,
              header=aepp.config.header,
              **kwargs):
     """
     Instantiate the DataAccess class.
     Arguments:
         config : OPTIONAL : config object in the config module. 
         header : OPTIONAL : header object  in the config module.
     Additional kwargs will update the header.
     """
     self.connector = connector.AdobeRequest(config_object=config,
                                             header=header)
     self.header = self.connector.header
     self.header.update(**kwargs)
     self.sandbox = self.connector.config['sandbox']
     self.endpoint = aepp.config.endpoints[
         "global"] + aepp.config.endpoints["ingestion"]
     self.endpoint_streaming = aepp.config.endpoints["streaming"][
         "collection"]
     self.STREAMING_REFERENCE = {
         "header": {
             "schemaRef": {
                 "id":
                 "https://ns.adobe.com/{TENANT_ID}/schemas/{SCHEMA_ID}",
                 "contentType":
                 "application/vnd.adobe.xed-full+json;version={SCHEMA_VERSION}"
             },
             "imsOrgId": "{IMS_ORG_ID}",
             "datasetId": "{DATASET_ID}",
             "createdAt": "1526283801869",
             "source": {
                 "name": "{SOURCE_NAME}"
             }
         },
         "body": {
             "xdmMeta": {
                 "schemaRef": {
                     "id":
                     "https://ns.adobe.com/{TENANT_ID}/schemas/{SCHEMA_ID}",
                     "contentType":
                     "application/vnd.adobe.xed-full+json;version={SCHEMA_VERSION}"
                 }
             },
             "xdmEntity": {
                 "person": {
                     "name": {
                         "firstName": "Jane",
                         "middleName": "F",
                         "lastName": "Doe"
                     },
                     "birthDate": "1969-03-14",
                     "gender": "female"
                 },
                 "workEmail": {
                     "primary": True,
                     "address": "*****@*****.**",
                     "type": "work",
                     "status": "active"
                 }
             }
         }
     }