
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@covalent/data
Advanced tools
A golang based mock data server CLI, for use with Teradata Covalent Quickstart
covalent-data is a mock API server with the following features:
To run from source or to create your own executables, you must first install Go.
go get
go run server.go
/schema
directory and the /datum
directory must be in the root of this repo.The covalent-data CLI is available to download as a package in the npm repository.
npm install @covalent/data -g
covalent-data
To run from docker:
cd
into it.docker build -t covalent-data .
docker run -p 8080:8080 --name covalent-data covalent-data
docker stop covalent-data
covalent-data is included in the covalent-quickstart repo.
npm install
npm run start-api
(npm run stop-api
to stop the API server)ng serve
and go to http://localhost:4200covalent-data allows you to create custom CRUD endpoints.
On startup, it will automatically create these endpoints from yaml files in the /schemas
directory and seed them with mock data based on example files in the datum
directory.
There are two steps to customizing CRUD objects:
/schemas
directory.systems.yaml
will create GET, POST, PUT, PATCH, and DELETE at http://localhost:8080/systems)initial_entries
. This tells the API server how many initial entries to seed your table with.randomize
. This tells the API server whether you want the seed data randomized, or ordered. Ordered data can be useful if you need to have the same usernames across multiple objects, for example._systemname_
)- these will be discussed in the next step.systems.yaml:
initial_entries: 8
randmoize: false
name: _systemname_
status: _activity_
sessions: _session_
workloads: _workload_
will generate eight random JSON objects that look like this:
{
"name": "tdsystem",
"status": "active",
"sessions": "12",
"workloads": "55"
/datum
directory.systemname.txt
.tdsystem
).systemname.txt:
tdsystem
awssystem
aster
localsystem
Once your mock objects are created, run the mock server. You can then send RESTful commands to it! Try the following:
GET http://localhost:8080/ping
(this will return a pong)GET http://localhost:8080/systems
(this will return the fake systems defined by the schemas and datum)POST http://localhost:8080/systems
- send a body with this one to create a new entryGET http://localhost:8080/systems/{system_name}
PUT http://localhost:8080/systems/{system_name}
- send a body with this one to update the systemDELETE http://localhost:8080/systems/{system_name}
- delete the systemWe also support sorting and paging:
GET http://localhost:8080/users?sort={asc|desc}:{sortOnValue}&page=1&per_page=50
Covalent-data will create realistic chart data that you can use right away in your charts.
Send a POST http://localhost:8080/charts
with a body that's formatted as such:
{
"name": "my new chart",
"key": "MyChartKey",
"num_data_points": 60,
"interval_seconds": 90,
"y_axes": [
{
"name": "cpu",
"function_type": "black_friday"
},
{
"name": "hits",
"function_type": "sawtooth"
}
]
}
This will create 60 points, spaced 90 seconds apart, with two y-axes- cpu
and hits
.
IMPORTANT NOTE: if you omit num_data_points
(or set to 0) then the chart data will disappear as you consume it. Otherwise,
you will always get 60 time ordered data points in a queue.
The following function_types
for Y axes are available:
black_friday
sawtooth
sine
slow_rise
slow_decline
square
triangle
The value you set for key
is how you will access your mock chart data. This is an optional value, and if you dont set this, the API will assign a unique key for your mock chart data.
Send a GET http://localhost:8080/charts/MyChartKey
and you will get a JSON array back that looks similar to this:
[
{
"cpu": 3.4086436391430617,
"hits": 0,
"timestamp": 1474998463
},
{
"cpu": 3.436764648923683,
"hits": 1,
"timestamp": 1474998523
},
{
"cpu": 4.839440493047819,
"hits": 2,
"timestamp": 1474998583
},
{
"cpu": 3.871987273635802,
"hits": 3,
"timestamp": 1474998643
},
{
"cpu": 3.3517529842176668,
"hits": 4,
"timestamp": 1474998703
},
{
"cpu": 4.161895630999336,
"hits": 5,
"timestamp": 1474998763
}
]
FAQs
A golang based mock data server CLI, for use with Teradata Covalent Quickstart
The npm package @covalent/data receives a total of 39 weekly downloads. As such, @covalent/data popularity was classified as not popular.
We found that @covalent/data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.