Make 33 MCQs with answers and concise explanations for learning how to use the Hetzner…
- User
Make 33 MCQs with answers and concise explanations for learning how to use the Hetzner cloud service provider’s API.
- Assistant
Make 33 MCQs with answers and concise explanations for learning how to use the Hetzner cloud service provider’s API.
What is Hetzner Cloud? Answer: Hetzner Cloud is a cloud service provider that offers scalable and flexible virtual machines, storage, and networking resources.
What is an API? Answer: API stands for Application Programming Interface. It is a set of defined rules and protocols that enable different software applications to communicate with each other.
How can you create an API key in Hetzner Cloud? Answer: To create an API key in Hetzner Cloud, you need to log in to your account, navigate to the API section, and generate a new API key.
True or False: The Hetzner Cloud API supports both REST and GraphQL. Answer: True. The Hetzner Cloud API supports both RESTful (Representational State Transfer) and GraphQL (Query Language for APIs) approaches.
How can you authenticate API requests? Answer: API requests can be authenticated using the HTTP header "Authorization" with the value "Bearer " followed by the API key.
Which API endpoint would you use to list all available server types? Answer: You would use the "GET /server_types" endpoint to retrieve a list of available server types.
How can you create a new server using the Hetzner Cloud API? Answer: You can create a new server using the "POST /servers" endpoint and providing the necessary parameters such as the server name, location, and server type.
Which API endpoint can be used to resize a server? Answer: The "PUT /servers/{id}/actions/resize" endpoint can be used to resize a server by providing the new server type.
How can you delete a server using the Hetzner Cloud API? Answer: You can delete a server by calling the "DELETE /servers/{id}" endpoint, where {id} represents the server's unique identifier.
Which endpoint would you use to get information about a specific server? Answer: You would use the "GET /servers/{id}" endpoint, where {id} represents the server's unique identifier, to retrieve information about a specific server.
True or False: Hetzner Cloud API allows you to manage floating IPs for your servers. Answer: True. Hetzner Cloud API allows you to manage floating IPs for your servers, including assigning, unassigning, and listing them.
How can you retrieve a list of available data centers using the Hetzner Cloud API? Answer: You can use the "GET /datacenters" endpoint to retrieve a list of available data centers.
Which API endpoint allows you to create a new floating IP? Answer: The "POST /floating_ips" endpoint can be used to create a new floating IP.
How can you assign a floating IP to a server? Answer: You can assign a floating IP to a server by using the "POST /floating_ips/{ip}/actions/assign" endpoint, where {ip} represents the floating IP address.
What is the maximum number of floating IPs that can be assigned to a single server? Answer: The maximum number of floating IPs that can be assigned to a single server in Hetzner Cloud is 3.
True or False: Hetzner Cloud API allows you to manage SSH keys for your servers. Answer: True. Hetzner Cloud API allows you to manage SSH keys for your servers, including adding, removing, and listing them.
Which endpoint would you use to list all available SSH keys? Answer: You would use the "GET /ssh_keys" endpoint to list all available SSH keys.
How can you create a new SSH key using the Hetzner Cloud API? Answer: You can create a new SSH key by calling the "POST /ssh_keys" endpoint and providing the public key data.
Which API endpoint allows you to remove an SSH key from your account? Answer: The "DELETE /ssh_keys/{id}" endpoint allows you to remove an SSH key from your account, where {id} represents the SSH key's unique identifier.
True or False: Hetzner Cloud API provides detailed metrics and monitoring data for your servers. Answer: True. Hetzner Cloud API provides detailed metrics and monitoring data for your servers, including CPU usage, memory usage, and network traffic.
How can you retrieve the available metrics for a specific server using the Hetzner Cloud API? Answer: You can use the "GET /servers/{id}/metrics" endpoint to retrieve the available metrics for a specific server, where {id} represents the server's unique identifier.
Which API endpoint allows you to create a snapshot of a server? Answer: The "POST /servers/{id}/actions/create_snapshot" endpoint allows you to create a snapshot of a server, where {id} represents the server's unique identifier.
How can you retrieve a list of available snapshots using the Hetzner Cloud API? Answer: You can use the "GET /snapshots" endpoint to retrieve a list of available snapshots.
Which endpoint would you use to delete a specific snapshot? Answer: You would use the "DELETE /snapshots/{id}" endpoint to delete a specific snapshot, where {id} represents the snapshot's unique identifier.
True or False: Hetzner Cloud API allows you to manage volumes for your servers. Answer: True. Hetzner Cloud API allows you to manage volumes for your servers, including creating, attaching, detaching, and deleting them.
How can you create a new volume using the Hetzner Cloud API? Answer: You can create a new volume by calling the "POST /volumes" endpoint and providing the necessary parameters such as the volume name and size.
Which endpoint allows you to attach a volume to a specific server? Answer: The "POST /volumes/{id}/actions/attach" endpoint allows you to attach a volume to a specific server, where {id} represents the volume's unique identifier.
How can you resize a volume using the Hetzner Cloud API? Answer: You can resize a volume by using the "PUT /volumes/{id}/actions/resize" endpoint and specifying the new size, where {id} represents the volume's unique identifier.
True or False: Hetzner Cloud API allows you to manage load balancers. Answer: True. Hetzner Cloud API allows you to manage load balancers, including creating, updating, and deleting them.
How can you create a new load balancer using the Hetzner Cloud API? Answer: You can create a new load balancer by calling the "POST /load_balancers" endpoint and providing the necessary parameters such as the load balancer name and algorithm.
Which endpoint allows you to add a server to a load balancer? Answer: The "POST /load_balancers/{id}/actions/add_target" endpoint allows you to add a server to a load balancer, where {id} represents the load balancer's unique identifier.
How can you update the configuration of a load balancer using the Hetzner Cloud API? Answer: You can update the configuration of a load balancer by using the "PUT /load_balancers/{id}" endpoint and providing the new configuration parameters, where {id} represents the load balancer's unique identifier.
Which endpoint allows you to delete a specific load balancer? Answer: You would use the "DELETE /load_balancers/{id}" endpoint to delete a specific load balancer, where {id} represents the load balancer's unique identifier.
Explanation: These MCQs cover various aspects of using the Hetzner Cloud API, including authentication, server management, floating IPs, SSH keys, metrics, snapshots, volumes, and load balancers. Each question is followed by a concise explanation to help learners understand the correct answer and reinforce their knowledge of using the Hetzner Cloud service provider's API.
Not yet included in a published release.