dmi_open_data.forecastdata.DownloadForecastFilesApi¶
All URIs are relative to https://dmigw.govcloud.dk
| Method | HTTP request | Description |
|---|---|---|
| get_file | GET /v1/forecastdata/download/{file-name} | Download the given forecast file |
get_file¶
bytearray get_file(file_name)
Download the given forecast file
Example¶
- Api Key Authentication (api-key):
import dmi_open_data.forecastdata
from dmi_open_data.forecastdata.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://dmigw.govcloud.dk
# See configuration.py for a list of all supported configuration parameters.
configuration = dmi_open_data.forecastdata.Configuration(
host = "https://dmigw.govcloud.dk"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with dmi_open_data.forecastdata.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = dmi_open_data.forecastdata.DownloadForecastFilesApi(api_client)
file_name = 'file_name_example' # str |
try:
# Download the given forecast file
api_response = api_instance.get_file(file_name)
print("The response of DownloadForecastFilesApi->get_file:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DownloadForecastFilesApi->get_file: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| file_name | str |
Return type¶
bytearray
Authorization¶
HTTP request headers¶
- Content-Type: Not defined
- Accept: /, application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Operation | - |
| 4XX | Client Error - The request contains bad syntax or cannot be fulfilled.<br/>The body will be structured using this format:<br/>{\"message\":\"the error message\", \"status\":\"the value of the HTTP response code, e.g. 400 or 404\", \"error\":\"the value of the HTTP response code phrase \"} | - |
| 5XX | Server Error - The server failed to fulfill an apparently valid request.<br/>The body will be structured using this format:<br/>{\"message\":\"the error message\", \"status\":\"the value of the HTTP response code, e.g. 500 or 507\", \"error\":\"the value of the HTTP response code phrase \"} | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]