Пример #1
0
# Must have the requestID from getNetworkPIIRequests or getOrgPIIRequests
# don't confuse getNetworkPIIRequest with getNetworkPIIRequests
# or getOrgPIIRequest with getOrgPIIRequests

# API Documentation for this call:  https://dashboard.meraki.com/api_docs#return-a-pii-request

# If you don't have a test environment, you can use DevNet Meraki Cloud Sandbox with a free account:
# https://devnetsandbox.cisco.com/RM/Diagram/Index/a9487767-deef-4855-b3e3-880e7f39eadc?diagramType=Topology

# see getNetworkPIIRequest function in PIICalls module for details and arguments

# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['MY-DEFAULT']['API_KEY']
orgid = config['MY-DEFAULT']['ORG_ID']
networkid = config['MY-DEFAULT']['NETWORK_ID']
requestid = config['MY-DEFAULT']['PII_ID']

MyNetworkPIIRequest = PIICalls.getNetworkPIIRequest(apikey, orgid, requestid)
print('The following uses the Python json module to format and print the results of a single existing PII Request for the given Network: \n')
print(json.dumps(MyNetworkPIIRequest, indent=4, sort_keys=False))
# don't confuse getNetworkPIIRequest with getNetworkPIIRequests
# or getOrgPIIRequest with getOrgPIIRequests

# API Documentation for this call:  https://dashboard.meraki.com/api_docs#return-a-pii-request

# If you don't have a test environment, you can use DevNet Meraki Cloud Sandbox with a free account:
# https://devnetsandbox.cisco.com/RM/Diagram/Index/a9487767-deef-4855-b3e3-880e7f39eadc?diagramType=Topology

# see getOrgPIIRequest function in PIICalls module for details and arguments

# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['MY-DEFAULT']['API_KEY']
orgid = config['MY-DEFAULT']['ORG_ID']
requestid = config['MY-DEFAULT']['PII_ID']

MyOrgPIIRequest = PIICalls.getOrgPIIRequest(apikey, orgid, requestid)
print(
    'The following uses the Python json module to format and print the results of a single existing PII Request for the given org: \n'
)
print(json.dumps(MyOrgPIIRequest, indent=4, sort_keys=False))
# see getOrgPIIKeys function in PIICalls module for details and arguments

# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['DEFAULT-KEYS-EMAIL']['API_KEY']
orgid = config['DEFAULT-KEYS-EMAIL']['ORG_ID']
identifier_value = config['DEFAULT-KEYS-EMAIL']['IDENTIFIER_VALUE']
identifier_type = config['DEFAULT-KEYS-EMAIL']['IDENTIFIER_TYPE']

print(
    '\nAssociated PII Keys from this call can be used in PII delete or restrict processing requests.'
    '\n'
    'See "example19-SubmitNewOrgDelRequest-MAC" and above for PII delete or restrict processing requests.'
    '\n\n'
    'Making PII Key API call for identifier_value type ' + '"' +
    identifier_type + '"' + ' with the value of ' + '"' + identifier_value +
    '"' + ':'
    '\n...')

MyOrgPIIKeys = PIICalls.getOrgPIIKeys(apikey, orgid, identifier_type,
                                      identifier_value)
print(json.dumps(MyOrgPIIKeys, indent=4, sort_keys=False))
Пример #4
0
# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# from here on out, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['DEFAULT-KEYS-EMAIL']['API_KEY']
networkid = config['DEFAULT-KEYS-EMAIL']['NETWORK_ID']
identifier_type = config['DEFAULT-KEYS-EMAIL']['IDENTIFIER_TYPE']
identifier_value = config['DEFAULT-KEYS-EMAIL']['IDENTIFIER_VALUE']

print(
    '\nAssociated PII Keys from this call can be used in PII delete or restrict processing requests.'
    '\n'
    'See "example19-SubmitNewOrgDelRequest-MAC" and above for PII delete or restrict processing requests.'
    '\n\n'
    'Making PII Key API call for identifier_value type ' + '"' +
    identifier_type + '"' + ' with the value of ' + '"' + identifier_value +
    '"' + ':'
    '\n...')

MyNetworkPIIKeys = PIICalls.getNetworkPIIKeys(apikey, networkid,
                                              identifier_type,
                                              identifier_value)
print(json.dumps(MyNetworkPIIKeys, indent=4, sort_keys=False))
Пример #5
0
# mac usually applies only to a WIFI network with a splash page and local (Meraki) auth
# basically sending a DELETE PII request to a WIFI network/org will remove
#  user's mac and other data under WIRELESS --> SPLASH LOGINS  in the Meraki Dashboard
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['DEFAULT-KEYS-MAC']['API_KEY']
orgid = config['DEFAULT-KEYS-MAC']['ORG_ID']
# set "action" (delete or restrict processing) argument directly rather than read from config.ini
# restrict processing - only applies to smDeviceID, smUserId, or mac
action = 'delete'
# set IDENTIFIER_TYPE to type 'mac'
identifier_type = config['DELETE-AND-RESTRICT-DATA']['IDENTIFIER_TYPE_MAC']
# set IDENTIFIER to an actual mac address value in config.ini
identifier_value = config['DELETE-AND-RESTRICT-DATA']['IDENTIFIER_VALUE_MAC']
# datasets are relative to action = 'delete' (delete PII data) and vary depending upon the identifier_type
# see the API documentation
# for MerakiPII.PIICalls module, you can call one or more seperated by a space
# as long as 1 or more datasets are valid for that identifier_type (e.g. mac takes the datasets: users loginAttempts)
datasets = 'users loginAttempts'

print('Submitting ' + '"' + action + '"' + ' request for '
      '"' + identifier_type + '"' + ' with the value of ' + '"' +
      identifier_value + '"' + ': \n')

MyNewOrgPIIRequest = PIICalls.submitOrgPIIRequest(apikey,
                                                  orgid,
                                                  action,
                                                  identifier_type,
                                                  identifier_value,
                                                  datasets=datasets)
print(json.dumps(MyNewOrgPIIRequest, indent=4, sort_keys=False))
Пример #6
0
# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['MDM-DEFAULT']['API_KEY']
orgid = config['MDM-DEFAULT']['ORG_ID']
identifier_value = config['MDM-DEFAULT']['IDENTIFIER_VALUE_USERNAME']
identifier_type = config['MDM-DEFAULT']['IDENTIFIER_TYPE_USERNAME']

print('\n')
print(
    '**The Org/Network used in this call MUST be a Systems Manager enabled Org/Network**'
)
print('\n')
print(
    'Making PII API Call to retrieve Systems Manager Owner ID for identifier_value type '
    + '"' + identifier_type + '"' + ' with the value of ' + '"' +
    identifier_value + '"' + ': \n')
print('\n')

MyOrgSMOwners = PIICalls.getOrgSMOwnersForKey(apikey, orgid, identifier_type,
                                              identifier_value)
print(json.dumps(MyOrgSMOwners, indent=4, sort_keys=False))
Пример #7
0
# https://dashboard.meraki.com/api_docs#given-a-piece-of-personally-identifiable-information-pii-return-the-systems-manager-owner-ids-associated-with-that-identifier

# If you don't have a test environment, you can use DevNet Meraki Cloud Sandbox with a free account:
# https://devnetsandbox.cisco.com/RM/Diagram/Index/a9487767-deef-4855-b3e3-880e7f39eadc?diagramType=Topology

# see getOrgSMDevicesForKey function in PIICalls module for details and arguments

# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['MDM-DEFAULT']['API_KEY']
networkid = config['MDM-DEFAULT']['NETWORK_ID']
identifier_value = config['MDM-DEFAULT']['IDENTIFIER_VALUE_MAC']
identifier_type = config['MDM-DEFAULT']['IDENTIFIER_TYPE_MAC']

print('\n')
print('**The Org/Network used in this call MUST be a Systems Manager enabled Org/Network**')
print('\n')
print('Making PII API Call to retrieve Systems Manager Owner ID for identifier_value type ' + '"' + identifier_type + '"' + ' with the value of '+ '"' + identifier_value + '"' + ': \n')
print('\n')

MyNetworkSMOwners = PIICalls.getNetworkSMOwnersForKey(apikey, networkid, identifier_type, identifier_value)
print(json.dumps(MyNetworkSMOwners, indent=4, sort_keys=False))
Пример #8
0
# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['MDM-DEFAULT']['API_KEY']
orgid = config['MDM-DEFAULT']['ORG_ID']

# assign all ID and ID values from config.ini MULTIPLE-ID-VALUES section to a list
MY_LIST_VALUES = list(config.items('MDM-VALUES'))

# set an indice value of 2 to assign every pair of IDENTIFIER and IDENTIFIER_TYPE from config.ini
# MULTIPLE-ID-VALUES to a nested list
n_indices = 2
# loop through all values in list loaded from MULTIPLE-ID-VALUES section of config.ini
for i in range(0, len(MY_LIST_VALUES), n_indices):
    # assign every nested pair to config_list1 and config_list2 respectively.  \
    # Note that this is usuall frowned upon, use w/ caution if reusing this code [zb]
    config_list1, config_list2 = MY_LIST_VALUES[i:i + n_indices]
    # set identifier_type to the value of config_list1
    identifier_type = (config_list1[1])
    # set identifier to the value of config_list2
    identifier = (config_list2[1])
    # simple print statement to let us know what IDs we are dealing with
    print('\n\n' + 'Printing next API call for identifier type ' + '"' +
          identifier_type + '"' + ' and identifier ' + '"' + identifier + '"')

    # make an API call for each pair in config.ini MULTIPLE-ID-VALUES section passing in the pair of ID_type and ID
    MyMultipleOrgSMKeys = PIICalls.getOrgSMOwnersForKey(
        apikey, orgid, identifier_type, identifier)
    # print output per API call in for loop using json.dumps
    print(json.dumps(MyMultipleOrgSMKeys, indent=4, sort_keys=False))
# API Documentation for this call:  
# https://dashboard.meraki.com/api_docs#delete-a-restrict-processing-pii-request

# If you don't have a test environment, you can use DevNet Meraki Cloud Sandbox with a free account:
# https://devnetsandbox.cisco.com/RM/Diagram/Index/a9487767-deef-4855-b3e3-880e7f39eadc?diagramType=Topology

# see submitOrgPIIRequest function in PIICalls module for details and arguments

# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
# it would be helpful to read through the API documentation for this call/function
# username usually applies only to a WIFI network with a splash page and local (Meraki) auth
# basically sending a DELETE PII request to a WIFI network/org will remove
#  user's username and other data under WIRELESS --> SPLASH LOGINS  in the Meraki Dashboard
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['DEFAULT-KEYS-EMAIL']['API_KEY']
orgid = config['DEFAULT-KEYS-EMAIL']['ORG_ID']
# please note this ONLY applies to requestIDs of type 'Restrict Procressing'
requestid = config['MY-DEFAULT']['PII_ID']

MyDelPIIRequest = PIICalls.delOrgPIIRequest(apikey, orgid, requestid)
print(json.dumps(MyDelPIIRequest, indent=4, sort_keys=False))
Пример #10
0
# https://dashboard.meraki.com/api_docs#given-a-piece-of-personally-identifiable-information-pii-return-the-systems-manager-device-ids-associated-with-that-identifier_value

# If you don't have a test environment, you can use DevNet Meraki Cloud Sandbox with a free account:
# https://devnetsandbox.cisco.com/RM/Diagram/Index/a9487767-deef-4855-b3e3-880e7f39eadc?diagramType=Topology

# see getOrgSMDevicesForKey function in PIICalls module for details and arguments

# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['MDM-DEFAULT']['API_KEY']
orgid = config['MDM-DEFAULT']['ORG_ID']
identifier_value = config['MDM-DEFAULT']['IDENTIFIER_VALUE_USERNAME']
identifier_type = config['MDM-DEFAULT']['IDENTIFIER_TYPE_USERNAME']

print('\n')
print('**The Org/Network used in this call MUST be a Systems Manager enabled Org/Network**')
print('\n')
print('Making PII API Call to retrieve Systems Manager Device ID for identifier_value type ' + '"' + identifier_type + '"' + ' with the value of '+ '"' + identifier_value + '"' + ': \n')
print('\n')
    
MyOrgSMDevices = PIICalls.getOrgSMDevicesForKey(apikey, orgid, identifier_type, identifier_value)
print(json.dumps(MyOrgSMDevices, indent=4, sort_keys=False))
Пример #11
0
# API Documentation for this call:  https://dashboard.meraki.com/api_docs#list-the-pii-requests-for-this-network-or-organization

# If you don't have a test environment, you can use DevNet Meraki Cloud Sandbox with a free account:
# https://devnetsandbox.cisco.com/RM/Diagram/Index/a9487767-deef-4855-b3e3-880e7f39eadc?diagramType=Topology

# see getNetworkPIIRequests function in PIICalls module for details and arguments
# and see the 1st example (example1getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['MY-DEFAULT']['API_KEY']
orgid = config['MY-DEFAULT']['ORG_ID']
networkid = config['MY-DEFAULT']['NETWORK_ID']

MyNetworkPIIRequests = PIICalls.getNetworkPIIRequests(apikey, orgid, networkid)
print(
    'The following uses the Python json module to format and print the results of MyNetworkPIIRequests: \n'
)
print(
    'If no PII delete or restrict processing requests have been made for the given NetworkID, you will not get data \n'
)

print(json.dumps(MyNetworkPIIRequests, indent=4, sort_keys=False))
# API Documentation for this call:  https://dashboard.meraki.com/api_docs#list-the-pii-requests-for-this-network-or-organization

# If you don't have a test environment, you can use DevNet Meraki Cloud Sandbox with a free account:
# https://devnetsandbox.cisco.com/RM/Diagram/Index/a9487767-deef-4855-b3e3-880e7f39eadc?diagramType=Topology

# see getOrgPIIRequests function in PIICalls module for details and arguments

# see the 1st example (example1-getOrgPIIRequests.py) for various ways to assign values for API calls
# for this file and other examples, we are using config.ini file for values

# next line imports PIICalls.py from the MerakiPII directory
from MerakiPII import PIICalls
import configparser
import json

# load config.ini and assign config variables from appropriate section to variables
config = configparser.ConfigParser()
config.read('config.ini')
apikey = config['MY-DEFAULT']['API_KEY']
orgid = config['MY-DEFAULT']['ORG_ID']

MyOrgPIIRequests = PIICalls.getOrgPIIRequests(apikey, orgid)
print(
    'The following uses the Python json module to format and print the results of MyOrgPIIRequests: \n'
)
print(
    'If no PII delete or restrict processing requests have been made for the given OrgID, you will not get data \n'
)

print(json.dumps(MyOrgPIIRequests, indent=4, sort_keys=False))