odweather
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_odweather_1.5.1.png)
ballerinax/odweather Ballerina library
Overview
This is a generated connector for ODWeather API v1.0 OpenAPI specification. The ODWeather API provides the capability to access the real time and forecast ocean information.
Quickstart
To use the ODWeather connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
Import the ballerinax/odweather module into the Ballerina project.
import ballerinax/odweather;
Step 2: Create a new connector instance
odweather:Client weatherClient = check new();
Step 3: Invoke connector operation
-
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to get web cams information using the connector.public function main() returns error? { http:Response entity = check weatherClient->getWebCams()(); }
-
Use
bal run
command to compile and run the Ballerina program.
Clients![](/images/permalink.svg)
odweather: Client![](/images/permalink.svg)
This is a generated connector for ODWeather API v1.0 OpenAPI specification. The ODWeather API provides the capability to access the real time and forecast ocean information.
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization does not require setting the API credentials.
init (ConnectionConfig config, string serviceUrl)
- config ConnectionConfig {} - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.oceandrivers.com/" - URL of the target service
compareStation![](/images/permalink.svg)
Get forecast and realtime information for known points
Parameters
- stationName string - Weather station to compare, values: cnareanl|rcnp | cmsap|boyaenderrocat|areopuertopalma | EWXXX
getAemetStation![](/images/permalink.svg)
Get data from the aemet stations
Parameters
- stationName string - station name currently: aeropuertopalma | caboblanco
- period string - Period of time to get the data. Options: lastdata lastday
getEasywind![](/images/permalink.svg)
Get data from the easywind weather stations
Parameters
- easywindId string - currently: 'EW013'|'EW008'
- period string - Period of time to get the data latestdata|latesthour|latestday
getEventStations![](/images/permalink.svg)
Get stations in an event
Parameters
- eventId string - currently: 'trofeoprincesasofia|palmavela'
getForecastPoints![](/images/permalink.svg)
Get forecast points of a yatchclub
getForecastTimeSeries![](/images/permalink.svg)
function getForecastTimeSeries(decimal latitude, decimal longitude, string weather, string? inittime, string? endtime, int? days, int? hours, string? wave, string? entryid) returns Response|error
Get timeseries forecast information
Parameters
- latitude decimal - latitude for the forecast
- longitude decimal - longitude for the forecast
- weather string - Comma separated values for the weather parameteres temperature,rain,wind_u,wind_v,gust,pressure,cloud,humidity&wave=height,direction,period
- inittime string? (default ()) - initial date for the forecast ISO string YYYY-MM-DDTHH:mm:SS.SZ
- endtime string? (default ()) - end date for the forecast ISO string YYYY-MM-DDTHH:mm:SS.SZ
- days int? (default ()) - optional number of days in string. Will be added to init forecast date
- hours int? (default ()) - optional number of hours in string. Will be added to init forecast date
- wave string? (default ()) - Comma separated values for the wave parameteres height,direction,period
- entryid string? (default ()) - Direct file I want to extract
getForecastTimeSeriesWrf![](/images/permalink.svg)
function getForecastTimeSeriesWrf(decimal latitude, decimal longitude, string weather, string? inittime, string? endtime, int? days, int? hours, string? wave, string? entryid) returns Response|error
Get timeseries forecast information
Parameters
- latitude decimal - latitude for the forecast
- longitude decimal - longitude for the forecast
- weather string - Comma separated values for the weather parameteres temperature,rain,wind_u,wind_v,gust,pressure,cloud,humidity&wave=height,direction,period
- inittime string? (default ()) - initial date for the forecast ISO string YYYY-MM-DDTHH:mm:SS.SZ
- endtime string? (default ()) - end date for the forecast ISO string YYYY-MM-DDTHH:mm:SS.SZ
- days int? (default ()) - optional number of days in string. Will be added to init forecast date
- hours int? (default ()) - optional number of hours in string. Will be added to init forecast date
- wave string? (default ()) - Comma separated values for the wave parameteres height,direction,period
- entryid string? (default ()) - Direct file I want to extract
getSocibWeatherStation![](/images/permalink.svg)
Get data from the socib bahia de palma buoy
Parameters
- stationName string - station name currently: boyaenderrocat | playadepalma
- period string - Period of time to get the data. Options: lastdata lasthour lastday
getWeatherDisplay![](/images/permalink.svg)
Get data from the weather display software
Parameters
- stationName string - currently: 'cnarenal'|'campastilla' | 'cncg'
- period string - Period of time to get the data latestdata|latesthour|latestday|dailylog
getWebCams![](/images/permalink.svg)
Get forecast and realtime information for known points
Records![](/images/permalink.svg)
odweather: ClientHttp1Settings![](/images/permalink.svg)
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
odweather: ConnectionConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
odweather: ProxyConfig![](/images/permalink.svg)
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
Import
import ballerinax/odweather;
Metadata
Released date: over 1 year ago
Version: 1.5.1
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 1
Current verison: 1
Weekly downloads
Keywords
Lifestyle & Entertainment/News & Lifestyle
Cost/Free
Contributors
Dependencies