22 Dec 2023
09:50 AM
- last edited on
22 Dec 2023
11:08 AM
by
Ana_Kuzmenchuk
With the command ‘monaco download --manifest manifest.yaml --environment development-environment --api dashboard,’ it can download all dashboards from the target Dynatrace environment. I have a specific dashboard with the ID ‘20103b07-fe23-4811-b514-96d7d177a716.’ Can I use ‘monaco download’ to only download this specific dashboard? I don't want to download all the dashboards.
I didn't see such a function introduced in https://docs.dynatrace.com/docs/manage/configuration-as-code/monaco/reference/commands
Solved! Go to Solution.
22 Dec 2023 11:29 AM
Hi,
Maybe with this option:
But I would download all to know object ID. I hope someone can provide a better answer.
Best regards
29 Dec 2023 09:47 AM
It seems that the provided solution is for configuring settings, not for API. What I am looking for is the API parameter to specify the UUID using the Monaco download command. Ideally, a command like the following:
monaco download --manifest manifest.yaml --environment development-environment --api dashboard --id '20103b07-fe23-4811-b514-96d7d177a716'
29 Dec 2023 10:57 AM
Hi,
Then, I think it is not possible actually. You can create a product idea.
Best regards
02 Jan 2024 11:10 AM
You can use https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs
It is more flexible
You will need CLI or some script like this to add separate files into state:
if TERRAFORM_IMPORT:
"""Loop for import"""
os.environ['DYNATRACE_ENV_URL'] = DYNATRACE_ENV_URL
os.environ['DYNATRACE_API_TOKEN'] = DYNATRACE_API_TOKEN
os.environ['DYNATRACE_TERRAFORM_BIN'] = DYNATRACE_TERRAFORM_BIN
with open(CSV_FILE_NAME, newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['IMPORT_CMD_PATH'], row['RESOURCE_ID'])
IMPORT_CMD_PATH = row['IMPORT_CMD_PATH']
RESOURCE_ID = row['RESOURCE_ID']
"""import all resources - ignore ignore already imported warning"""
try:
terraform_import = subprocess.Popen(
args=["terraform", "import", IMPORT_CMD_PATH, RESOURCE_ID],
cwd=PROJECT_FOLDER)
error = terraform_import.communicate()
except:
Exception(error)