{"id":19598854,"url":"https://github.com/victorshinya/instance-scheduler","last_synced_at":"2025-06-14T15:40:08.775Z","repository":{"id":121945491,"uuid":"290381251","full_name":"victorshinya/instance-scheduler","owner":"victorshinya","description":"IBM Cloud Virtual Server Instance scheduler to power off and power on automatically.","archived":false,"fork":false,"pushed_at":"2021-10-06T23:37:37.000Z","size":575,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-09T07:49:19.741Z","etag":null,"topics":["ibm-cloud","instance-scheduler","power-off","power-on","serverless","serverless-functions","softlayer"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victorshinya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-26T03:05:07.000Z","updated_at":"2021-10-06T23:37:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef5990b1-7435-4d75-8241-43313d15bdfc","html_url":"https://github.com/victorshinya/instance-scheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorshinya%2Finstance-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorshinya%2Finstance-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorshinya%2Finstance-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorshinya%2Finstance-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victorshinya","download_url":"https://codeload.github.com/victorshinya/instance-scheduler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240876854,"owners_count":19871903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ibm-cloud","instance-scheduler","power-off","power-on","serverless","serverless-functions","softlayer"],"created_at":"2024-11-11T09:08:08.232Z","updated_at":"2025-02-26T15:17:12.352Z","avatar_url":"https://github.com/victorshinya.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IBM Cloud Instance Scheduler\n\n[![IBM Cloud Powered](https://img.shields.io/badge/IBM%20Cloud-powered-blue.svg)](https://cloud.ibm.com)\n[![Platform](https://img.shields.io/badge/platform-golang-lightgrey.svg?style=flat)](https://developer.ibm.com/?s=golang/)\n[![Go Report Card](https://goreportcard.com/badge/github.com/victorshinya/go-cloud)](https://goreportcard.com/report/github.com/victorshinya/instance-scheduler)\n[![LICENSE](https://img.shields.io/github/license/victorshinya/instance-scheduler)](https://github.com/victorshinya/instance-scheduler/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/victorshinya/instance-scheduler/pulls)\n\nA Serverless function to automatically start and stop IBM Cloud Virtual Server Instances.\n\n![Architecture Diagram](doc/source/images/architecture.png)\n\n## Deploy to IBM Cloud\n\nBefore you get started, you need to install [IBM Cloud CLI](https://cloud.ibm.com/docs/cli/reference/ibmcloud/download_cli.html#install_use) and [IBM Cloud Functions CLI](https://cloud.ibm.com/openwhisk/learn/cli) in your local machine. Then, you need to login in your IBM Cloud account on IBM Cloud CLI (if you haven't already done, run `ibmcloud login`).\n\n### 1. Clone the repository\n\nDownload the source code from Github and access the project folder.\n\n```sh\ngit clone https://github.com/victorshinya/instance-scheduler.git\ncd instance-scheduler\n```\n\n### 2. Get Username and generate Classic Infrastructure API key\n\nAs you can manage your infrastructure using a SDK or API, you have to authenticate with a `username` and `apikey`. To get your username for the current account and generate the classic infrastructure API key. Go to [Manage \u003e Access (IAM) \u003e Users](https://cloud.ibm.com/iam/users) and click on your name on the list.\n\n![Instance Scheduler 01](doc/source/images/Instance_Scheduler_01.png)\n\n1. Scroll down to the `VPN password` section and copy the `Username`. This is going to be used on Instance Scheduler.\n2. Scroll down to the `API keys` section and click on `Create classic infrastructure key` to automatically generate your API key. Copy the key. You are going to use it with `username`.\n\n![Instance Scheduler 02](doc/source/images/Instance_Scheduler_02.png)\n\n### 3. Set up the environment variables to deploy them as function's parameters\n\nRun the following command with the classic infrastructure username and API key, and the list with all Virtual Servers to power on/off:\n\n- SOFTLAYER_USERNAME is the `Username` field that you copied from previous step.\n- SOFTLAYER_APIKEY is the `API key`, generated in the previous step.\n- VSIS_NAME is the list with all Virtual Servers on Classic IaaS (Softlayer) that you'd like to power on/off - e.g. `'[\"VSI NAME 01\", \"VSI NAME 02\", \"SO ON, AND ON\"]'`.\n\n```sh\nexport SOFTLAYER_USERNAME=\"\" SOFTLAYER_APIKEY=\"\" VSIS_NAME='[\"\"]'\n```\n\n### 4. Set the time to power off and power on the VSI\n\nIn [`manifest.yml`](manifest.yml) file, it is set (by default) to power off the VSI at 03:00 AM (00:00 AM GMT-3) and to power on the VSI at 09:00 AM (06:00 AM GMT-3). Update if you need to run both actions at the desire hour.\n\n### 5. Deploy the Action, Triggers and Rules\n\nRun the following command to deploy `handler.go` function and to set up the Triggers and Rules.\n\n\u003e As you are using IBM Cloud Functions, you don't need to install any package or setup a package.json. The platform already has all libraries required to run the source code.\n\n```sh\nibmcloud fn deploy --manifest manifest.yml\n```\n\n## LICENSE\n\nCopyright 2021 Victor Shinya\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorshinya%2Finstance-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorshinya%2Finstance-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorshinya%2Finstance-scheduler/lists"}