Skip to main content
PUT
/
query-rewrite
/
{type}
Enable or disable a query rewrite
import requests

url = "https://{FUSION HOST}/api/query-rewrite/{type}"

payload = {
    "app": "<string>",
    "type": "<string>",
    "enabled": True,
    "numDeployed": 123,
    "collection": "<string>",
    "job": "<string>",
    "lastDeployedOn": "2023-11-07T05:31:56Z",
    "lastJobStatus": {
        "resource": "`spark:api-test-app_synonym_detection`",
        "runId": "<string>",
        "startTime": "2023-11-07T05:31:56Z",
        "endTime": "2023-11-07T05:31:56Z",
        "status": "<string>",
        "error": {},
        "extra": {},
        "startedBy": "<string>"
    }
}
headers = {
    "Authorization": "Basic <encoded-value>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
{
  "app": "<string>",
  "type": "<string>",
  "enabled": true,
  "numDeployed": 123,
  "collection": "<string>",
  "job": "<string>",
  "lastDeployedOn": "2023-11-07T05:31:56Z",
  "lastJobStatus": {
    "resource": "`spark:api-test-app_synonym_detection`",
    "runId": "<string>",
    "startTime": "2023-11-07T05:31:56Z",
    "endTime": "2023-11-07T05:31:56Z",
    "status": "<string>",
    "error": {},
    "extra": {},
    "startedBy": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

type
string
required

The query rewrite type. Use /query-rewrite/schema to get the available query rewrite types.

Query Parameters

context
string
required

The app to which this object belongs, as app:SomeApp. If the app doesn't exist, the request fails. Other comma-separated contexts in the context parameter are allowed but ignored.

Body

application/json
app
string

The Fusion app to which this query rewrite belongs.

type
string

The query rewrite type.

enabled
boolean

true if this query rewrite is enabled.

numDeployed
integer<int64>

The number of deployed (published) query rewrites of this type.

collection
string

The data collection to which this query rewrite belongs.

job
string

The job type: spark, datasource, or task.

lastDeployedOn
string<date-time>

The date and time at which this query rewrite was last deployed.

lastJobStatus
object

Response

200 - */*

OK

app
string

The Fusion app to which this query rewrite belongs.

type
string

The query rewrite type.

enabled
boolean

true if this query rewrite is enabled.

numDeployed
integer<int64>

The number of deployed (published) query rewrites of this type.

collection
string

The data collection to which this query rewrite belongs.

job
string

The job type: spark, datasource, or task.

lastDeployedOn
string<date-time>

The date and time at which this query rewrite was last deployed.

lastJobStatus
object