Skip to content

Host Migration

Joshua Hiller edited this page Nov 22, 2024 · 1 revision

CrowdStrike Falcon CrowdStrike Subreddit

Using the Host Migration service collection

Uber class support Service class support Documentation Version Page Updated

Table of Contents

Operation ID Description
HostMigrationAggregatesV1
PEP8 aggregate_host_migration
Get host migration aggregates as specified via json in request body.
MigrationAggregatesV1
PEP8 aggregate_migration
Get migration aggregates as specified via json in request body.
HostMigrationsActionsV1
PEP8 perform_host_migration_action
Perform an action on host migrations.
GetHostMigrationsV1
PEP8 Eachobjectisdefinedbytheactionfield.
Get host migration details.
GetMigrationDestinationsV1
PEP8 get_migration_destination
Get destinations for a migration.
MigrationsActionsV1
PEP8 perform_migration_job_action
Perform an action on a migration job.
GetMigrationsV1
PEP8 get_migration_job_details
Get migration job details.
CreateMigrationV1
PEP8 create_migration
Create a device migration job.
GetHostMigrationIDsV1
PEP8 query_host_migration_ids
Query host migration IDs.
GetMigrationIDsV1
PEP8 query_migration_jobs
Query migration jobs.

HostMigrationAggregatesV1

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

PEP8 method name

aggregate_host_migration

Endpoint

Method Route
POST /host-migration/aggregates/host-migrations/v1

Required Scope

host-migration:write

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
body Service Class Support Uber Class Support
body list of dictionaries Full body payload in JSON format.
date_ranges Service Class Support No Uber Class Support body list of dictionaries Applies 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"
  }
]
exclude Service Class Support No Uber Class Support body string Elements to exclude.
field Service Class Support No Uber Class Support body string The field on which to compute the aggregation.
filter Service Class Support No Uber Class Support body string FQL syntax formatted string to use to filter the results.
from Service Class Support No Uber Class Support body integer Starting position.
include Service Class Support No Uber Class Support body string Elements to include.
interval Service Class Support No Uber Class Support body string Time interval for date histogram aggregations. Valid values include:
  • year
  • month
  • week
  • day
  • hour
  • minute
max_doc_count Service Class Support No Uber Class Support body integer Only return buckets if values are less than or equal to the value here.
min_doc_count Service Class Support No Uber Class Support body integer Only return buckets if values are greater than or equal to the value here.
missing Service Class Support No Uber Class Support body string Missing 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.
name Service Class Support No Uber Class Support body string Name of the aggregate query, as chosen by the user. Used to identify the results returned to you.
q Service Class Support No Uber Class Support body string Full text search across all metadata fields.
ranges Service Class Support No Uber Class Support body list of dictionaries Applies 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
  }
]
size Service Class Support No Uber Class Support body integer The max number of term buckets to be returned.
sub_aggregates Service Class Support No Uber Class Support body list of dictionaries A nested aggregation, such as:
[
  {
    "name": "max_first_behavior",
    "type": "max",
    "field": "first_behavior"
  }
]

There is a maximum of 3 nested aggregations per request.
sort Service Class Support No Uber Class Support body string FQL 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_zone Service Class Support No Uber Class Support body string Time zone for bucket results.
type Service Class Support No Uber Class Support body string Type 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

Method Route
POST /host-migration/aggregates/migrations/v1

Required Scope

host-migration:write

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
body Service Class Support Uber Class Support
body list of dictionaries Full body payload in JSON format.
date_ranges Service Class Support No Uber Class Support body list of dictionaries Applies 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"
  }
]
exclude Service Class Support No Uber Class Support body string Elements to exclude.
field Service Class Support No Uber Class Support body string The field on which to compute the aggregation.
filter Service Class Support No Uber Class Support body string FQL syntax formatted string to use to filter the results.
from Service Class Support No Uber Class Support body integer Starting position.
include Service Class Support No Uber Class Support body string Elements to include.
interval Service Class Support No Uber Class Support body string Time interval for date histogram aggregations. Valid values include:
  • year
  • month
  • week
  • day
  • hour
  • minute
max_doc_count Service Class Support No Uber Class Support body integer Only return buckets if values are less than or equal to the value here.
min_doc_count Service Class Support No Uber Class Support body integer Only return buckets if values are greater than or equal to the value here.
missing Service Class Support No Uber Class Support body string Missing 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.
name Service Class Support No Uber Class Support body string Name of the aggregate query, as chosen by the user. Used to identify the results returned to you.
q Service Class Support No Uber Class Support body string Full text search across all metadata fields.
ranges Service Class Support No Uber Class Support body list of dictionaries Applies 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
  }
]
size Service Class Support No Uber Class Support body integer The max number of term buckets to be returned.
sub_aggregates Service Class Support No Uber Class Support body list of dictionaries A nested aggregation, such as:
[
  {
    "name": "max_first_behavior",
    "type": "max",
    "field": "first_behavior"
  }
]

There is a maximum of 3 nested aggregations per request.
sort Service Class Support No Uber Class Support body string FQL 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_zone Service Class Support No Uber Class Support body string Time zone for bucket results.
type Service Class Support No Uber Class Support body string Type 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

Method Route
POST /host-migration/entities/host-migrations-actions/v1

Required Scope

host-migration:write

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
action_name Service Class Support Uber Class Support query string The action to perform. Allowed actions: remove_hosts, remove_host_groups, add_host_groups.
action_parameters Service Class Support Uber Class Support body dictionary Action parameters payload to execute.
body Service Class Support Uber Class Support body string Full body payload as a JSON formatted dictionary. Not required if using other keyword arguments.
filter Service Class Support Uber Class Support body string FQL 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.
id Service Class Support Uber Class Support query string The migration job to perform actions on.
ids Service Class Support Uber Class Support body string or list of strings Migration IDs to target.
parameters Service Class Support Uber Class Support query dictionary Full 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

Method Route
POST /host-migration/entities/host-migrations/GET/v1

Required Scope

host-migration:read

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
body Service Class Support Uber Class Support body dictionary Full body payload in JSON format. Not required when using other keywords.
ids Service Class Support Uber Class Support body string or list of strings Migration 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

Method Route
POST /host-migration/entities/migration-destinations/GET/v1

Required Scope

host-migration:read

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
body Service Class Support Uber Class Support body string Full body payload as a JSON formatted dictionary. Not required if using other keyword arguments.
filter Service Class Support Uber Class Support body string FQL 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_ids Service Class Support Uber Class Support body string or list of strings Device 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

Method Route
POST /host-migration/entities/migrations-actions/v1

Required Scope

host-migration:write

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
action_name Service Class Support Uber Class Support query string The action to perform. Allowed actions: start_migration, cancel_migration, rename_migration, and delete_migration.
action_parameters Service Class Support Uber Class Support body dictionary Action parameters payload to execute.
body Service Class Support Uber Class Support body string Full body payload as a JSON formatted dictionary. Not required if using other keyword arguments.
filter Service Class Support Uber Class Support body string FQL 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.
ids Service Class Support Uber Class Support body string or list of strings Migration ID to target.
parameters Service Class Support Uber Class Support query dictionary Full 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

Method Route
GET /host-migration/entities/migrations/v1

Required Scope

host-migration:read

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
ids Service Class Support Uber Class Support query string or list of strings The migration jobs of interest.
parameters Service Class Support Uber Class Support query dictionary Full 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

Method Route
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.

Name Service Uber Type Data type Description
body Service Class Support Uber Class Support body string Full body payload as a JSON formatted dictionary. Not required if using other keyword arguments.
device_ids Service Class Support Uber Class Support body string or list of strings
filter Service Class Support Uber Class Support body string FQL formatted filter to identify devices for the migration.
name Service Class Support Uber Class Support body string Name of the migration job.
target_cid Service Class Support Uber Class Support body string CID 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

Method Route
GET /host-migration/queries/host-migrations/v1

Required Scope

host-migration:read

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
id Service Class Support Uber Class Support query string The migration job to query
filter Service Class Support Uber Class Support query string The 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
limit Service Class Support Uber Class Support query integer The maximum records to return. [1-10000]
offset Service Class Support Uber Class Support query integer The offset to start retrieving records from
parameters Service Class Support Uber Class Support query dictionary Full query string parameters payload in JSON format.
sort Service Class Support Uber Class Support query string The 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

Method Route
GET /host-migration/queries/migrations/v1

Required Scope

host-migration:read

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
filter Service Class Support Uber Class Support query string The 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
limit Service Class Support Uber Class Support query integer The maximum records to return. [1-10000]
offset Service Class Support Uber Class Support query integer The offset to start retrieving records from
parameters Service Class Support Uber Class Support query dictionary Full query string parameters payload in JSON format.
sort Service Class Support Uber Class Support query string The 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

CrowdStrike Falcon

Clone this wiki locally