https://github.com/trainline/envmgr-lib
Powertools for working with the Environment Manager API
https://github.com/trainline/envmgr-lib
Last synced: 8 months ago
JSON representation
Powertools for working with the Environment Manager API
- Host: GitHub
- URL: https://github.com/trainline/envmgr-lib
- Owner: trainline
- License: other
- Created: 2017-04-12T09:58:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-05T16:33:36.000Z (over 8 years ago)
- Last Synced: 2025-09-27T21:19:09.591Z (8 months ago)
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# envmgr-lib
[](https://travis-ci.org/trainline/envmgr-lib)
```bash
# Get all AMIs
amis = AMI.get_all()
# Create an ASG instance
asg = ASG('my-asg-name', 'PROD')
# Check the remote ASG exists
asg_exists = asg.exists()
# Get the ASG schedule
asg_schedule = asg.get_schedule()
# Set the ASG schedule
asg.set_schedule('ON')
# Get ASG status
status = asg.get_status()
# Get ASG health
health = asg.get_health()
# Get instances with AMI older than certain age
instances = Instance.get_instances_by_ami_age(30)
# Create a Service instance
service = Service('MyService', 'PROD')
# Get Service health
health = service.get_health()
# Get inactive slices:
slices = service.get_slices(False)
# Publish an open file handle as version 2.0.0 of the service
service.publish(file, '2.0.0')
# Publish an open file handle as version 2.0.0 of the service
# configured for environment MyEnv
service.publish(file, '2.0.0', 'MyEnv')
# Deploy the service
deploy_id = service.deploy()
#Get the deployment info
service.get_deployment()
# Toggle the service and get toggle status
upstream = service.toggle()
status = upstream.get_status()
```