CrowdStrike Falcon CrowdStrike Subreddit

Using the Host Migration service collection

Uber class support Service class support Documentation Version Page Updated

Table of Contents

Operation IDDescription
HostMigrationAggregatesV1
PEP8aggregate_host_migration
Get host migration aggregates as specified via json in request body.
MigrationAggregatesV1
PEP8aggregate_migration
Get migration aggregates as specified via json in request body.
HostMigrationsActionsV1
PEP8perform_host_migration_action
Perform an action on host migrations.
GetHostMigrationsV1
PEP8Eachobjectisdefinedbytheactionfield.
Get host migration details.
GetMigrationDestinationsV1
PEP8get_migration_destination
Get destinations for a migration.
MigrationsActionsV1
PEP8perform_migration_job_action
Perform an action on a migration job.
GetMigrationsV1
PEP8get_migration_job_details
Get migration job details.
CreateMigrationV1
PEP8create_migration
Create a device migration job.
GetHostMigrationIDsV1
PEP8query_host_migration_ids
Query host migration IDs.
GetMigrationIDsV1
PEP8query_migration_jobs
Query migration jobs.

HostMigrationAggregatesV1

Get host migration aggregates as specified via json in request body.

PEP8 method name

aggregate_host_migration

Endpoint

MethodRoute
POST/host-migration/aggregates/host-migrations/v1

Required Scope

host-migration:write

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
bodyService Class SupportUber Class Support
bodylist of dictionariesFull body payload in JSON format.
date_rangesService Class SupportNo Uber Class Supportbodylist of dictionariesApplies to date_range aggregations.

Example:
[
  {
    "from": "2016-05-28T09:00:31Z",
    "to": "2016-05-30T09:00:31Z"
  },
  {
    "from": "2016-06-01T09:00:31Z",
    "to": "2016-06-10T09:00:31Z"
  }
]
excludeService Class SupportNo Uber Class SupportbodystringElements to exclude.
fieldService Class SupportNo Uber Class SupportbodystringThe field on which to compute the aggregation.
filterService Class SupportNo Uber Class SupportbodystringFQL syntax formatted string to use to filter the results.
fromService Class SupportNo Uber Class SupportbodyintegerStarting position.
includeService Class SupportNo Uber Class SupportbodystringElements to include.
intervalService Class SupportNo Uber Class SupportbodystringTime interval for date histogram aggregations. Valid values include:
  • year
  • month
  • week
  • day
  • hour
  • minute
max_doc_countService Class SupportNo Uber Class SupportbodyintegerOnly return buckets if values are less than or equal to the value here.
min_doc_countService Class SupportNo Uber Class SupportbodyintegerOnly return buckets if values are greater than or equal to the value here.
missingService Class SupportNo Uber Class SupportbodystringMissing is the value to be used when the aggregation field is missing from the object. In other words, the missing parameter defines how documents that are missing a value should be treated. By default they will be ignored, but it is also possible to treat them as if they had a value.
nameService Class SupportNo Uber Class SupportbodystringName of the aggregate query, as chosen by the user. Used to identify the results returned to you.
qService Class SupportNo Uber Class SupportbodystringFull text search across all metadata fields.
rangesService Class SupportNo Uber Class Supportbodylist of dictionariesApplies to range aggregations. Ranges values will depend on field.

For example, if max_severity is used, ranges might look like:
[
  {
    "From": 0,
    "To": 70
  },
  {
    "From": 70,
    "To": 100
  }
]
sizeService Class SupportNo Uber Class SupportbodyintegerThe max number of term buckets to be returned.
sub_aggregatesService Class SupportNo Uber Class Supportbodylist of dictionariesA nested aggregation, such as:
[
  {
    "name": "max_first_behavior",
    "type": "max",
    "field": "first_behavior"
  }
]

There is a maximum of 3 nested aggregations per request.
sortService Class SupportNo Uber Class SupportbodystringFQL syntax string to sort bucket results.
  • _count - sort by document count
  • _term - sort by the string value alphabetically
Supports asc and desc using | format.

Example: _count|desc
time_zoneService Class SupportNo Uber Class SupportbodystringTime zone for bucket results.
typeService Class SupportNo Uber Class SupportbodystringType of aggregation. Valid values include:
  • date_histogram - Aggregates counts on a specified time interval. Requires use of “interval” field.
  • date_range - Aggregates counts on custom defined date range buckets. Can include multiple ranges. (Similar to time series, but the bucket sizes are variable). Date formats to follow ISO 8601.
  • terms - Buckets alerts by the value of a specified field. For example, if field used is scenario, then alerts will be bucketed by the various alert scenario names.
  • range - Buckets alerts by specified (numeric) ranges of a specified field. For example, if doing a range aggregation on the max_severity field, the alerts will be counted by the specified ranges of severity.
  • cardinality - Returns the count of distinct values in a specified field.
  • max - Returns the maximum value of a specified field.
  • min - Returns the minimum value of a specified field.
  • avg - Returns the average value of the specified field.
  • sum - Returns the total sum of all values for the specified field.
  • percentiles - Returns the following percentiles for the specified field: 1, 5, 25, 50, 75, 95, 99.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

response = falcon.aggregate_host_migration(date_ranges=date_ranges,
                                           exclude="string",
                                           field="string",
                                           filter="string",
                                           from=integer,
                                           include="string",
                                           interval="string",
                                           max_doc_count=integer,
                                           min_doc_count=integer,
                                           missing="string",
                                           name="string",
                                           q="string",
                                           ranges=ranges,
                                           size=integer,
                                           sort="string",
                                           time_zone="string",
                                           type="string"
                                           )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

response = falcon.HostMigrationAggregatesV1(date_ranges=date_ranges,
                                            exclude="string",
                                            field="string",
                                            filter="string",
                                            from=integer,
                                            include="string",
                                            interval="string",
                                            max_doc_count=integer,
                                            min_doc_count=integer,
                                            missing="string",
                                            name="string",
                                            q="string",
                                            ranges=ranges,
                                            size=integer,
                                            sort="string",
                                            time_zone="string",
                                            type="string"
                                            )
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

body_payload = [{
    "date_ranges": date_ranges,
    "exclude": "string",
    "field": "string",
    "filter": "string",
    "from": integer,
    "include": "string",
    "interval": "string",
    "max_doc_count": integer,
    "min_doc_count": integer,
    "missing": "string",
    "name": "string",
    "q": "string",
    "ranges": ranges,
    "size": integer,
    "sort": "string",
    "sub_aggregates": [
        null
    ]
    "time_zone": "string",
    "type": "string"
}]

response = falcon.command("HostMigrationAggregatesV1", body=body_payload)
print(response)

Back to Table of Contents

MigrationAggregatesV1

Get migration aggregates as specified via json in request body.

PEP8 method name

aggregate_migration

Endpoint

MethodRoute
POST/host-migration/aggregates/migrations/v1

Required Scope

host-migration:write

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
bodyService Class SupportUber Class Support
bodylist of dictionariesFull body payload in JSON format.
date_rangesService Class SupportNo Uber Class Supportbodylist of dictionariesApplies to date_range aggregations.

Example:
[
  {
    "from": "2016-05-28T09:00:31Z",
    "to": "2016-05-30T09:00:31Z"
  },
  {
    "from": "2016-06-01T09:00:31Z",
    "to": "2016-06-10T09:00:31Z"
  }
]
excludeService Class SupportNo Uber Class SupportbodystringElements to exclude.
fieldService Class SupportNo Uber Class SupportbodystringThe field on which to compute the aggregation.
filterService Class SupportNo Uber Class SupportbodystringFQL syntax formatted string to use to filter the results.
fromService Class SupportNo Uber Class SupportbodyintegerStarting position.
includeService Class SupportNo Uber Class SupportbodystringElements to include.
intervalService Class SupportNo Uber Class SupportbodystringTime interval for date histogram aggregations. Valid values include:
  • year
  • month
  • week
  • day
  • hour
  • minute
max_doc_countService Class SupportNo Uber Class SupportbodyintegerOnly return buckets if values are less than or equal to the value here.
min_doc_countService Class SupportNo Uber Class SupportbodyintegerOnly return buckets if values are greater than or equal to the value here.
missingService Class SupportNo Uber Class SupportbodystringMissing is the value to be used when the aggregation field is missing from the object. In other words, the missing parameter defines how documents that are missing a value should be treated. By default they will be ignored, but it is also possible to treat them as if they had a value.
nameService Class SupportNo Uber Class SupportbodystringName of the aggregate query, as chosen by the user. Used to identify the results returned to you.
qService Class SupportNo Uber Class SupportbodystringFull text search across all metadata fields.
rangesService Class SupportNo Uber Class Supportbodylist of dictionariesApplies to range aggregations. Ranges values will depend on field.

For example, if max_severity is used, ranges might look like:
[
  {
    "From": 0,
    "To": 70
  },
  {
    "From": 70,
    "To": 100
  }
]
sizeService Class SupportNo Uber Class SupportbodyintegerThe max number of term buckets to be returned.
sub_aggregatesService Class SupportNo Uber Class Supportbodylist of dictionariesA nested aggregation, such as:
[
  {
    "name": "max_first_behavior",
    "type": "max",
    "field": "first_behavior"
  }
]

There is a maximum of 3 nested aggregations per request.
sortService Class SupportNo Uber Class SupportbodystringFQL syntax string to sort bucket results.
  • _count - sort by document count
  • _term - sort by the string value alphabetically
Supports asc and desc using | format.

Example: _count|desc
time_zoneService Class SupportNo Uber Class SupportbodystringTime zone for bucket results.
typeService Class SupportNo Uber Class SupportbodystringType of aggregation. Valid values include:
  • date_histogram - Aggregates counts on a specified time interval. Requires use of “interval” field.
  • date_range - Aggregates counts on custom defined date range buckets. Can include multiple ranges. (Similar to time series, but the bucket sizes are variable). Date formats to follow ISO 8601.
  • terms - Buckets alerts by the value of a specified field. For example, if field used is scenario, then alerts will be bucketed by the various alert scenario names.
  • range - Buckets alerts by specified (numeric) ranges of a specified field. For example, if doing a range aggregation on the max_severity field, the alerts will be counted by the specified ranges of severity.
  • cardinality - Returns the count of distinct values in a specified field.
  • max - Returns the maximum value of a specified field.
  • min - Returns the minimum value of a specified field.
  • avg - Returns the average value of the specified field.
  • sum - Returns the total sum of all values for the specified field.
  • percentiles - Returns the following percentiles for the specified field: 1, 5, 25, 50, 75, 95, 99.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

response = falcon.aggregate_migration(date_ranges=date_ranges,
                                      exclude="string",
                                      field="string",
                                      filter="string",
                                      from=integer,
                                      include="string",
                                      interval="string",
                                      max_doc_count=integer,
                                      min_doc_count=integer,
                                      missing="string",
                                      name="string",
                                      q="string",
                                      ranges=ranges,
                                      size=integer,
                                      sort="string",
                                      time_zone="string",
                                      type="string"
                                      )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

response = falcon.MigrationAggregatesV1(date_ranges=date_ranges,
                                        exclude="string",
                                        field="string",
                                        filter="string",
                                        from=integer,
                                        include="string",
                                        interval="string",
                                        max_doc_count=integer,
                                        min_doc_count=integer,
                                        missing="string",
                                        name="string",
                                        q="string",
                                        ranges=ranges,
                                        size=integer,
                                        sort="string",
                                        time_zone="string",
                                        type="string"
                                        )
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

body_payload = [{
    "date_ranges": date_ranges,
    "exclude": "string",
    "field": "string",
    "filter": "string",
    "from": integer,
    "include": "string",
    "interval": "string",
    "max_doc_count": integer,
    "min_doc_count": integer,
    "missing": "string",
    "name": "string",
    "q": "string",
    "ranges": ranges,
    "size": integer,
    "sort": "string",
    "sub_aggregates": [
        null
    ]
    "time_zone": "string",
    "type": "string"
}]

response = falcon.command("MigrationAggregatesV1", body=body_payload)
print(response)

Back to Table of Contents

HostMigrationsActionsV1

Perform an action on host migrations.

PEP8 method name

perform_host_migration_action

Endpoint

MethodRoute
POST/host-migration/entities/host-migrations-actions/v1

Required Scope

host-migration:write

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
action_nameService Class SupportUber Class SupportquerystringThe action to perform. Allowed actions: remove_hosts, remove_host_groups, add_host_groups.
action_parametersService Class SupportUber Class SupportbodydictionaryAction parameters payload to execute.
bodyService Class SupportUber Class SupportbodystringFull body payload as a JSON formatted dictionary. Not required if using other keyword arguments.
filterService Class SupportUber Class SupportbodystringFQL formatted filter to use to identify migration IDs to target. Allowed filters: groups, hostgroups, static_host_groups, hostname, status, target_cid, source_cid, migration_id, id, host_migration_id, and created_time.
idService Class SupportUber Class SupportquerystringThe migration job to perform actions on.
idsService Class SupportUber Class Supportbodystring or list of stringsMigration IDs to target.
parametersService Class SupportUber Class SupportquerydictionaryFull query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

action_parameters = [{
    "name": "string",
    "value": "string"
}]

response = falcon.perform_host_migration_action(action_name="string",
                                                action_parameters=action_parameters,
                                                filter="string",
                                                id="string",
                                                ids=id_list
                                                )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

action_parameters = [{
    "name": "string",
    "value": "string"
}]

response = falcon.HostMigrationsActionsV1(action_name="string",
                                          action_parameters=action_parameters,
                                          filter="string",
                                          id="string",
                                          ids=id_list
                                          )
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

id_list = ['ID1', 'ID2', 'ID3']

body_payload = {
  "action_parameters": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "filter": "string",
  "ids": id_list
}

response = falcon.command("HostMigrationsActionsV1",
                          action_name="string",
                          id="string",
                          body=body_payload
                          )
print(response)

Back to Table of Contents

GetHostMigrationsV1

Get host migration details.

PEP8 method name

Eachobjectisdefinedbytheactionfield.

Endpoint

MethodRoute
POST/host-migration/entities/host-migrations/GET/v1

Required Scope

host-migration:read

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
bodyService Class SupportUber Class SupportbodydictionaryFull body payload in JSON format. Not required when using other keywords.
idsService Class SupportUber Class Supportbodystring or list of stringsMigration IDs to retrieve.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.Eachobjectisdefinedbytheactionfield_(ids=id_list)
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.GetHostMigrationsV1(ids=id_list)
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.command("GetHostMigrationsV1", ids=id_list)
print(response)

Back to Table of Contents

GetMigrationDestinationsV1

Get destinations for a migration.

PEP8 method name

get_migration_destination

Endpoint

MethodRoute
POST/host-migration/entities/migration-destinations/GET/v1

Required Scope

host-migration:read

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
bodyService Class SupportUber Class SupportbodystringFull body payload as a JSON formatted dictionary. Not required if using other keyword arguments.
filterService Class SupportUber Class SupportbodystringFQL formatted filter to use to identify migration IDs to target. Allowed filters: groups, hostgroups, static_host_groups, hostname, status, target_cid, source_cid, migration_id, id, host_migration_id, and created_time.
device_idsService Class SupportUber Class Supportbodystring or list of stringsDevice IDs to target.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.get_migration_destination(filter="string", device_ids=id_list)
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.GetMigrationDestinationsV1(filter="string", device_ids=id_list)
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

id_list = ['ID1', 'ID2', 'ID3']

body_payload = {
  "device_ids": id_list,
  "filter": "string"
}

response = falcon.command("GetMigrationDestinationsV1", body=body_payload)
print(response)

Back to Table of Contents

MigrationsActionsV1

Perform an action on a migration job.

PEP8 method name

perform_migration_job_action

Endpoint

MethodRoute
POST/host-migration/entities/migrations-actions/v1

Required Scope

host-migration:write

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
action_nameService Class SupportUber Class SupportquerystringThe action to perform. Allowed actions: start_migration, cancel_migration, rename_migration, and delete_migration.
action_parametersService Class SupportUber Class SupportbodydictionaryAction parameters payload to execute.
bodyService Class SupportUber Class SupportbodystringFull body payload as a JSON formatted dictionary. Not required if using other keyword arguments.
filterService Class SupportUber Class SupportbodystringFQL formatted filter to use to identify migration IDs to target. Allowed filters: groups, hostgroups, static_host_groups, hostname, status, target_cid, source_cid, migration_id, id, host_migration_id, and created_time.
idsService Class SupportUber Class Supportbodystring or list of stringsMigration ID to target.
parametersService Class SupportUber Class SupportquerydictionaryFull query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

action_parameters = [{
    "name": "string",
    "value": "string"
}]

response = falcon.perform_migration_job_action(action_name="string",
                                               action_parameters=action_parameters,
                                               filter="string",
                                               ids=id_list
                                               )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

action_parameters = [{
    "name": "string",
    "value": "string"
}]

response = falcon.MigrationsActionsV1(action_name="string",
                                      action_parameters=action_parameters,
                                      filter="string",
                                      ids=id_list
                                      )
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

id_list = ['ID1', 'ID2', 'ID3']

body_payload = {
  "action_parameters": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "filter": "string",
  "ids": id_list
}

response = falcon.command("MigrationsActionsV1", action_name="string", body=body_payload)
print(response)

Back to Table of Contents

GetMigrationsV1

Get migration job details.

PEP8 method name

get_migration_job_details

Endpoint

MethodRoute
GET/host-migration/entities/migrations/v1

Required Scope

host-migration:read

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
idsService Class SupportUber Class Supportquerystring or list of stringsThe migration jobs of interest.
parametersService Class SupportUber Class SupportquerydictionaryFull query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.get_migration_job_details(ids=id_list)
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.GetMigrationsV1(ids=id_list)
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.command("GetMigrationsV1", ids=id_list)
print(response)

CreateMigrationV1

Create a device migration job.

PEP8 method name

create_migration

Endpoint

MethodRoute
POST/host-migration/entities/migrations/v1

Required Scope

host-migration:write

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

The device_ids and filter arguments are mutually exclusive. When both are provided, the filter argument takes precedence.

NameServiceUberTypeData typeDescription
bodyService Class SupportUber Class SupportbodystringFull body payload as a JSON formatted dictionary. Not required if using other keyword arguments.
device_idsService Class SupportUber Class Supportbodystring or list of strings
filterService Class SupportUber Class SupportbodystringFQL formatted filter to identify devices for the migration.
nameService Class SupportUber Class SupportbodystringName of the migration job.
target_cidService Class SupportUber Class SupportbodystringCID the migration job targets.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.create_migration(device_ids=id_list,
                                   filter="string",
                                   name="string",
                                   target_cid="string"
                                   )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )
id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.CreateMigrationV1(device_ids=id_list,
                                    filter="string",
                                    name="string",
                                    target_cid="string"
                                    )
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

id_list = ['ID1', 'ID2', 'ID3']

body_payload = {
  "device_ids": id_list,
  "filter": "string",
  "name": "string",
  "target_cid": "string"
}

response = falcon.command("CreateMigrationV1", body=body_payload)
print(response)

Back to Table of Contents

GetHostMigrationIDsV1

Query host migration IDs.

PEP8 method name

query_host_migration_ids

Endpoint

MethodRoute
GET/host-migration/queries/host-migrations/v1

Required Scope

host-migration:read

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
idService Class SupportUber Class SupportquerystringThe migration job to query
filterService Class SupportUber Class SupportquerystringThe filter expression that should be used to limit the results. Valid fields: static_host_groups, source_cid, migration_id, groups, hostgroups, target_cid, id, created_time, host_migration_id, hostname, status
limitService Class SupportUber Class SupportqueryintegerThe maximum records to return. [1-10000]
offsetService Class SupportUber Class SupportqueryintegerThe offset to start retrieving records from
parametersService Class SupportUber Class SupportquerydictionaryFull query string parameters payload in JSON format.
sortService Class SupportUber Class SupportquerystringThe property to sort by.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

response = falcon.query_host_migration_ids(id="string",
                                           offset=integer,
                                           limit=integer,
                                           sort="string",
                                           filter="string"
                                           )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

response = falcon.GetHostMigrationIDsV1(id="string",
                                        offset=integer,
                                        limit=integer,
                                        sort="string",
                                        filter="string"
                                        )
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

response = falcon.command("GetHostMigrationIDsV1",
                          id="string",
                          offset=integer,
                          limit=integer,
                          sort="string",
                          filter="string"
                          )
print(response)

Back to Table of Contents

GetMigrationIDsV1

Query migration jobs.

PEP8 method name

query_migration_jobs

Endpoint

MethodRoute
GET/host-migration/queries/migrations/v1

Required Scope

host-migration:read

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
filterService Class SupportUber Class SupportquerystringThe filter expression that should be used to limit the results. Valid fields: status, migration_status, created_by, created_time, name, id, migration_id, target_cid
limitService Class SupportUber Class SupportqueryintegerThe maximum records to return. [1-10000]
offsetService Class SupportUber Class SupportqueryintegerThe offset to start retrieving records from
parametersService Class SupportUber Class SupportquerydictionaryFull query string parameters payload in JSON format.
sortService Class SupportUber Class SupportquerystringThe property to sort by.

Usage

Service class example (PEP8 syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

response = falcon.query_migration_jobs(offset=integer,
                                       limit=integer,
                                       sort="string",
                                       filter="string"
                                       )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostMigration

falcon = HostMigration(client_id=CLIENT_ID,
                       client_secret=CLIENT_SECRET
                       )

response = falcon.GetMigrationIDsV1(offset=integer,
                                    limit=integer,
                                    sort="string",
                                    filter="string"
                                    )
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

response = falcon.command("GetMigrationIDsV1",
                          offset=integer,
                          limit=integer,
                          sort="string",
                          filter="string"
                          )
print(response)

Back to Table of Contents