gcp-instance-scheduler

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 6 Imported by: 0

README

gcp-instance-scheduler

Start and stop scheduler for compute engines and cloud sql on GCP

License

Environment

  • PRINT_LOG : 1/0
  • SCHEDULER_DELAY : in second
  • SCHEDULER_CONFIG_FILE : must be existing path
file at ./env/sample.env

Config File

  • DAYS : separate by a comma. Sunday:0, Monday:1 ...
  • TYPE : VM or SQL
  • TIME : 00:00 to 23:59

If TYPE == SQL, then ZONE can be empty

configure this file on env: SCHEDULER_CONFIG_FILE

Watch the log file

On Linux/Mac
$ tail -f /your-directory/action.log  
$ tail -f /your-directory/error.log  
$ lnav /your-directory/action.log /your-directory/error.log

On Windows
using windows power shell
$ type -wait {path to action.log or error.log}

Build the project

$ GOOS=windows GOARCH=amd64 go build -o gcp-instance-scheduler.exe
$ GOOS=linux GOARCH=amd64 go build -o gcp-instance-scheduler
$ GOOS=darwin GOARCH=amd64 go build -o gcp-instance-scheduler

Load environment file

On windows
download the ./other/load-env.bat file
$ load-env.bat {.env file path}

On linux
$ set -o allexport; source {.env file path}; set +o allexport

Run the gcp-instance-scheduler

On windows
$ gcp-instance-scheduler.exe

On linux
$ ./gcp-instance-scheduler

API Endpoint

POST Method

  • /private/time
  • /private/day
  • /private/clear-console
  • /private/log-status
  • /private/reverse-log-status

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app
env

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL