Knowledge Check - Programmatic Foundations

Test your understanding of the key concepts from Module 1. Select the best answer for each question, then submit to see your results. You need to score at least 60% to pass.

1.

A developer's script sends POST https://api.ionos.com/cloudapi/v6/datacenters and receives 202 Accepted. The response body shows "state": "BUSY". The next step of the script creates a server in the new data center. What should the script do between the two calls?

2.

A CI job mints an access token with GET https://api.ionos.com/auth/v1/tokens/generate using an Authorization: Basic header. After the account enforces 2-Factor Authentication, the job can no longer get a token. Which change fixes the job?

3.

A developer writes a generator that returns every server in a large data center. Which line correctly completes the loop?

def list_all(session, url):
    params = {"offset": 0, "limit": 100}
    while url:
        page = session.get(url, params=params).json()
        yield from page.get("items", [])
        # missing line
        params = None
4.

TaskBoard's Terraform configuration contains this resource. A developer changes location from de/txl to de/fra and runs terraform plan.

resource "ionoscloud_datacenter" "taskboard" {
  name     = "taskboard-dev"
  location = "de/txl"
}

What does the plan show?

5.

A server was created by hand with ionosctl in Unit 1.1. A developer wants to bring it under Terraform management as ionoscloud_server.api and generate its configuration. Which approach is correct?