npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ami-motley-tool

v0.1.8

Published

Utility methods for AMI.

Downloads

16

Readme

AMI Motley Tool

npm version

Utility methods for AMI.

Instration

$ npm install ami-motley-tool

Usase

var AmiMotleyTool = require("ami-motley-tool");
var amt = new AmiMotleyTool();

amt.getSortedGroupImages({ Name: "Foo", Role: "Web Server" }, "BuildNo").then(function(images) {
  ...
}).catch(function(err) {
  console.log(err.stack);
});

amt.createImageAndSnapshotWithTags({ Name: "ami001", InstanceId: "i-123123123" }, function() { console.log("wait for creating AMI..."); }).then(function(imageId) {
  ...
}).catch(function(err) {
  console.log(err.stack);
});

Methods

See source.

Utility Methods

|method|arg1|arg2|arg3|return|description| |---|---|---|---|---|---| |getTagValue|description (instance, image, other AWS resources){ Xxx: "yyy", Tags: [ { Name: "foo1", Value: "bar1" }, { Name: "foo2", Value: "bar2" } ] }|key"foo1"||"bar1" (or null)|get target tag value from description of image or instance.| |covertTagsToMap|tags[ { Name: "foo", Value: "bar" }, { Name: "foo2", Value: "bar2" }... ]|||{ foo: bar, foo2: bar2 }|convert tags to map.| |getFilters|groupTag{ foo: "bar", foo2: "bar2" }|||[ { Name: "tag:foo", Values: [ "bar" ] }, { Name: "tag:foo2", Values: [ "bar2" ] }... ]|get filters from group.|

AWS Methods

|method|arg1|arg2|arg3|return|description| |---|---|---|---|---|---| |getGroupImages|groupTag{ foo: "bar", foo2: "bar2" }|||Promise(images)|get filtered (groupTag) images. groupTag is tag set.| |getSortedGroupImages|groupTag{ foo: "bar", foo2: "bar2" }|versionTag"BuildNo"||Promise(images)|get filtered (groupTag) and sorted (versionTag ASC as string) images. groupTag is tag set.| |deleteOldImagesAndSnapshots|groupTag{ foo: "bar", foo2: "bar2" }|versionTag"BuildNo"|callbackWait|Promise|delete old images and snapshots in target group. (keep latest one)| |getUsedImageIds|targetTag{ foo: "bar", foo2: "bar2" }|||Promise|get used image IDs in target group. (AutoScalingGroup and EC2 Instance)| |deleteUnusedImagesAndSnapshots|groupTag{ foo: "bar", foo2: "bar2" }|targetTag{ foo: "bar", foo2: "bar2" }|callbackWait|Promise|delete unused images and snapshots in target group. (AutoScalingGroup and EC2 Instance)| |createImageAndSnapshotWithTags|opts(InstanceId and Name required.AWS CreateImage Property)|callbackWait||Promise(imageId)|create image and snapshots with tags of target instance. Tag keys starting with "aws:" are reserved.| |setTagsToImage|imageId|tags||Promise|set tags to image.| |setTagsToSnapshot|imageId|tags||Promise|set tags to snapshot.| |waitAvailableAmi|imageId|callbackWait||Promisetrue:AMI launched.false:AMI launch failed.)|wait available AMI.| |waitUnavailableAmi|imageId|callbackWait||Promisetrue:AMI unavailable.false:error.)|wait unavailable AMI.|

License

Copyright 2016 t-yamo

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.