Compare commits
56 Commits
c364efd8e8
...
26adee27e6
Author | SHA1 | Date | |
---|---|---|---|
26adee27e6 | |||
779d940849 | |||
ae07f82dd5 | |||
b2bd779de7 | |||
18a0ed5ce4 | |||
c84baf5152 | |||
06040ac649 | |||
1c072c454d | |||
1ba69e38ed | |||
5df8ae8edd | |||
c6524ff1d3 | |||
088638661a | |||
a3fd680ea6 | |||
94fa9acc44 | |||
b84120efe3 | |||
13ffb063c5 | |||
35eec03142 | |||
633ccac42d | |||
fb36dc83d5 | |||
a58a2cba41 | |||
26daedbd72 | |||
6a109f2a5a | |||
2f36f82363 | |||
db4037111f | |||
49089ff433 | |||
db82116103 | |||
bad00517a3 | |||
c3da8c067f | |||
4a6f49ac3b | |||
4dacca2d46 | |||
cbb6116a61 | |||
b603822679 | |||
3b249d62b9 | |||
6b97fed499 | |||
2d977b03a4 | |||
024ba8ee8f | |||
9e02196dd0 | |||
64dc7b5772 | |||
3834fe6a49 | |||
4bc8889d32 | |||
63ff325068 | |||
c18de40edd | |||
d04e7b22e4 | |||
f95de3457c | |||
1950cdaba0 | |||
e49ed1b7ad | |||
e5b3f03681 | |||
5ee53a493d | |||
e3ec2b8c2e | |||
8760662cf7 | |||
5be18af930 | |||
46cc57ac2d | |||
9f5c380b66 | |||
c2dc55c8ff | |||
e6f7ab003d | |||
cfdf4a3141 |
|
@ -2,14 +2,14 @@ name: AWS-Zig Build
|
|||
run-name: ${{ github.actor }} building AWS Zig SDK
|
||||
on: [push]
|
||||
jobs:
|
||||
build-zig-0.9-amd64-host:
|
||||
build-zig-0.11.0-amd64-host:
|
||||
runs-on: ubuntu-latest
|
||||
# Need to use the default container with node and all that, so we can
|
||||
# use JS-based actions like actions/checkout@v3...
|
||||
# container:
|
||||
# image: alpine:3.15.0
|
||||
env:
|
||||
ZIG_VERSION: 0.9.0
|
||||
ZIG_VERSION: 0.11.0
|
||||
ARCH: x86_64
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
|
@ -22,18 +22,15 @@ jobs:
|
|||
- run: wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz
|
||||
- run: tar x -C /usr/local -f zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz
|
||||
- run: ln -s /usr/local/zig-linux-${ARCH}-${ZIG_VERSION}/zig /usr/local/bin/zig
|
||||
- run: apt update && apt install --no-install-recommends git
|
||||
- run: (cd codegen && zig build test)
|
||||
- run: zig build -Dfetch # implicitly does a codegen
|
||||
- run: zig build test
|
||||
- run: zig build -Dtarget=arm-linux
|
||||
- run: zig build test --verbose
|
||||
- run: zig build --verbose -Dtarget=arm-linux
|
||||
- run: zig build -Dtarget=x86_64-windows
|
||||
- run: zig build -Dtarget=aarch64-linux
|
||||
- run: zig build -Dtarget=riscv64-linux
|
||||
- run: zig build -Dtarget=x86_64-macos
|
||||
- run: zig build -Dtarget=aarch64-macos
|
||||
- name: Notify
|
||||
uses: https://git.lerch.org/lobo/action-notify-ntfy@v1
|
||||
uses: https://git.lerch.org/lobo/action-notify-ntfy@v2
|
||||
if: always()
|
||||
with:
|
||||
host: ${{ secrets.NTFY_HOST }}
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,3 +10,4 @@ smithy/zig-out/
|
|||
libs/
|
||||
src/git_version.zig
|
||||
zig-out
|
||||
core
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
|
||||
ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
|
||||
b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
|
||||
MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
|
||||
b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
|
||||
ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
|
||||
9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
|
||||
IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
|
||||
VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
|
||||
93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
|
||||
jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
|
||||
AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA
|
||||
A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI
|
||||
U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs
|
||||
N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv
|
||||
o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
|
||||
5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
|
||||
rqXRfboQnoZsG4q5WTP468SQvvG5
|
||||
-----END CERTIFICATE-----
|
36
CopyStep.zig
36
CopyStep.zig
|
@ -1,36 +0,0 @@
|
|||
const std = @import("std");
|
||||
const CopyStep = @This();
|
||||
|
||||
step: std.build.Step,
|
||||
builder: *std.build.Builder,
|
||||
from_path: []const u8 = null,
|
||||
to_path: []const u8 = null,
|
||||
|
||||
pub fn create(
|
||||
b: *std.build.Builder,
|
||||
from_path_relative: []const u8,
|
||||
to_path_relative: []const u8,
|
||||
) *CopyStep {
|
||||
var result = b.allocator.create(CopyStep) catch @panic("memory");
|
||||
result.* = CopyStep{
|
||||
.step = std.build.Step.init(.custom, "copy a file", b.allocator, make),
|
||||
.builder = b,
|
||||
.from_path = std.fs.path.resolve(b.allocator, &[_][]const u8{
|
||||
b.build_root,
|
||||
from_path_relative,
|
||||
}) catch @panic("memory"),
|
||||
.to_path = std.fs.path.resolve(b.allocator, &[_][]const u8{
|
||||
b.build_root,
|
||||
to_path_relative,
|
||||
}) catch @panic("memory"),
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
fn make(step: *std.build.Step) !void {
|
||||
const self = @fieldParentPtr(CopyStep, "step", step);
|
||||
std.fs.copyFileAbsolute(self.from_path, self.to_path, .{}) catch |e| {
|
||||
std.log.err("Error copying {s} to {s}: {s}", .{ self.from_path, self.to_path, e });
|
||||
std.os.exit(1);
|
||||
};
|
||||
}
|
219
GitRepoStep.zig
219
GitRepoStep.zig
|
@ -1,219 +0,0 @@
|
|||
//! Publish Date: 2021_10_17
|
||||
//! This file is hosted at github.com/marler8997/zig-build-repos and is meant to be copied
|
||||
//! to projects that use it.
|
||||
const std = @import("std");
|
||||
const GitRepoStep = @This();
|
||||
|
||||
pub const ShaCheck = enum {
|
||||
none,
|
||||
warn,
|
||||
err,
|
||||
|
||||
pub fn reportFail(self: ShaCheck, comptime fmt: []const u8, args: anytype) void {
|
||||
switch (self) {
|
||||
.none => unreachable,
|
||||
.warn => std.log.warn(fmt, args),
|
||||
.err => {
|
||||
std.log.err(fmt, args);
|
||||
std.os.exit(0xff);
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
step: std.build.Step,
|
||||
builder: *std.build.Builder,
|
||||
url: []const u8,
|
||||
name: []const u8,
|
||||
branch: ?[]const u8 = null,
|
||||
sha: []const u8,
|
||||
path: []const u8 = null,
|
||||
sha_check: ShaCheck = .warn,
|
||||
fetch_enabled: bool,
|
||||
|
||||
var cached_default_fetch_option: ?bool = null;
|
||||
pub fn defaultFetchOption(b: *std.build.Builder) bool {
|
||||
if (cached_default_fetch_option) |_| {} else {
|
||||
cached_default_fetch_option = if (b.option(bool, "fetch", "automatically fetch network resources")) |o| o else false;
|
||||
}
|
||||
return cached_default_fetch_option.?;
|
||||
}
|
||||
|
||||
pub fn create(b: *std.build.Builder, opt: struct {
|
||||
url: []const u8,
|
||||
branch: ?[]const u8 = null,
|
||||
sha: []const u8,
|
||||
path: ?[]const u8 = null,
|
||||
sha_check: ShaCheck = .warn,
|
||||
fetch_enabled: ?bool = null,
|
||||
}) *GitRepoStep {
|
||||
var result = b.allocator.create(GitRepoStep) catch @panic("memory");
|
||||
const name = std.fs.path.basename(opt.url);
|
||||
result.* = GitRepoStep{
|
||||
.step = std.build.Step.init(.custom, "clone a git repository", b.allocator, make),
|
||||
.builder = b,
|
||||
.url = opt.url,
|
||||
.name = name,
|
||||
.branch = opt.branch,
|
||||
.sha = opt.sha,
|
||||
.path = if (opt.path) |p| (b.allocator.dupe(u8, p) catch @panic("memory")) else (std.fs.path.resolve(b.allocator, &[_][]const u8{
|
||||
b.build_root,
|
||||
"libs",
|
||||
name,
|
||||
})) catch @panic("memory"),
|
||||
.sha_check = opt.sha_check,
|
||||
.fetch_enabled = if (opt.fetch_enabled) |fe| fe else defaultFetchOption(b),
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
// TODO: this should be included in std.build, it helps find bugs in build files
|
||||
fn hasDependency(step: *const std.build.Step, dep_candidate: *const std.build.Step) bool {
|
||||
for (step.dependencies.items) |dep| {
|
||||
// TODO: should probably use step.loop_flag to prevent infinite recursion
|
||||
// when a circular reference is encountered, or maybe keep track of
|
||||
// the steps encounterd with a hash set
|
||||
if (dep == dep_candidate or hasDependency(dep, dep_candidate))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
fn make(step: *std.build.Step) !void {
|
||||
const self = @fieldParentPtr(GitRepoStep, "step", step);
|
||||
|
||||
std.fs.accessAbsolute(self.path, std.fs.File.OpenFlags{ .read = true }) catch {
|
||||
const branch_args = if (self.branch) |b| &[2][]const u8{ " -b ", b } else &[2][]const u8{ "", "" };
|
||||
if (!self.fetch_enabled) {
|
||||
std.debug.print("Error: git repository '{s}' does not exist\n", .{self.path});
|
||||
std.debug.print(" Use -Dfetch to download it automatically, or run the following to clone it:\n", .{});
|
||||
std.debug.print(" git clone {s}{s}{s} {s} && git -C {3s} checkout {s} -b for_ziget\n", .{ self.url, branch_args[0], branch_args[1], self.path, self.sha });
|
||||
std.os.exit(1);
|
||||
}
|
||||
|
||||
{
|
||||
var args = std.ArrayList([]const u8).init(self.builder.allocator);
|
||||
defer args.deinit();
|
||||
try args.append("git");
|
||||
try args.append("clone");
|
||||
// This is a bad idea, because we really want to get to the correct
|
||||
// revision before we go updating submodules
|
||||
// try args.append("--recurse-submodules");
|
||||
try args.append(self.url);
|
||||
// TODO: clone it to a temporary location in case of failure
|
||||
// also, remove that temporary location before running
|
||||
try args.append(self.path);
|
||||
if (self.branch) |branch| {
|
||||
try args.append("-b");
|
||||
try args.append(branch);
|
||||
}
|
||||
try run(self.builder, args.items);
|
||||
}
|
||||
try run(self.builder, &[_][]const u8{
|
||||
"git",
|
||||
"-C",
|
||||
self.path,
|
||||
"checkout",
|
||||
self.sha,
|
||||
"-b",
|
||||
"fordep",
|
||||
});
|
||||
|
||||
// Now that we're on the correct revision, we can update submodules
|
||||
try run(self.builder, &[_][]const u8{
|
||||
"git",
|
||||
"-C",
|
||||
self.path,
|
||||
"submodule",
|
||||
"update",
|
||||
"--init",
|
||||
"--recursive",
|
||||
});
|
||||
};
|
||||
|
||||
try self.checkSha();
|
||||
}
|
||||
|
||||
fn checkSha(self: GitRepoStep) !void {
|
||||
if (self.sha_check == .none)
|
||||
return;
|
||||
|
||||
const result: union(enum) { failed: anyerror, output: []const u8 } = blk: {
|
||||
const result = std.ChildProcess.exec(.{
|
||||
.allocator = self.builder.allocator,
|
||||
.argv = &[_][]const u8{
|
||||
"git",
|
||||
"-C",
|
||||
self.path,
|
||||
"rev-parse",
|
||||
"HEAD",
|
||||
},
|
||||
.cwd = self.builder.build_root,
|
||||
.env_map = self.builder.env_map,
|
||||
}) catch |e| break :blk .{ .failed = e };
|
||||
try std.io.getStdErr().writer().writeAll(result.stderr);
|
||||
switch (result.term) {
|
||||
.Exited => |code| {
|
||||
if (code == 0) break :blk .{ .output = result.stdout };
|
||||
break :blk .{ .failed = error.GitProcessNonZeroExit };
|
||||
},
|
||||
.Signal => break :blk .{ .failed = error.GitProcessFailedWithSignal },
|
||||
.Stopped => break :blk .{ .failed = error.GitProcessWasStopped },
|
||||
.Unknown => break :blk .{ .failed = error.GitProcessFailed },
|
||||
}
|
||||
};
|
||||
switch (result) {
|
||||
.failed => |err| {
|
||||
return self.sha_check.reportFail("failed to retreive sha for repository '{s}': {s}", .{ self.name, @errorName(err) });
|
||||
},
|
||||
.output => |output| {
|
||||
if (!std.mem.eql(u8, std.mem.trimRight(u8, output, "\n\r"), self.sha)) {
|
||||
return self.sha_check.reportFail("repository '{s}' sha does not match\nexpected: {s}\nactual : {s}\n", .{ self.name, self.sha, output });
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
fn run(builder: *std.build.Builder, argv: []const []const u8) !void {
|
||||
{
|
||||
var msg = std.ArrayList(u8).init(builder.allocator);
|
||||
defer msg.deinit();
|
||||
const writer = msg.writer();
|
||||
var prefix: []const u8 = "";
|
||||
for (argv) |arg| {
|
||||
try writer.print("{s}\"{s}\"", .{ prefix, arg });
|
||||
prefix = " ";
|
||||
}
|
||||
std.log.debug("[RUN] {s}", .{msg.items});
|
||||
}
|
||||
|
||||
const child = try std.ChildProcess.init(argv, builder.allocator);
|
||||
defer child.deinit();
|
||||
|
||||
child.stdin_behavior = .Ignore;
|
||||
child.stdout_behavior = .Inherit;
|
||||
child.stderr_behavior = .Inherit;
|
||||
child.cwd = builder.build_root;
|
||||
child.env_map = builder.env_map;
|
||||
|
||||
try child.spawn();
|
||||
const result = try child.wait();
|
||||
switch (result) {
|
||||
.Exited => |code| if (code != 0) {
|
||||
std.log.err("git clone failed with exit code {}", .{code});
|
||||
std.os.exit(0xff);
|
||||
},
|
||||
else => {
|
||||
std.log.err("git clone failed with: {}", .{result});
|
||||
std.os.exit(0xff);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Get's the repository path and also verifies that the step requesting the path
|
||||
// is dependent on this step.
|
||||
pub fn getPath(self: *const GitRepoStep, who_wants_to_know: *const std.build.Step) []const u8 {
|
||||
if (!hasDependency(who_wants_to_know, &self.step))
|
||||
@panic("a step called GitRepoStep.getPath but has not added it as a dependency");
|
||||
return self.path;
|
||||
}
|
521
Package.zig
Normal file
521
Package.zig
Normal file
|
@ -0,0 +1,521 @@
|
|||
const builtin = @import("builtin");
|
||||
const std = @import("std");
|
||||
const testing = std.testing;
|
||||
const Hasher = @import("codegen/src/Hasher.zig");
|
||||
|
||||
/// This is 128 bits - Even with 2^54 cache entries, the probably of a collision would be under 10^-6
|
||||
const bin_digest_len = 16;
|
||||
const hex_digest_len = bin_digest_len * 2;
|
||||
|
||||
const Package = @This();
|
||||
|
||||
root_src_directory: std.Build.Cache.Directory,
|
||||
|
||||
/// Whether to free `root_src_directory` on `destroy`.
|
||||
root_src_directory_owned: bool = false,
|
||||
allocator: std.mem.Allocator,
|
||||
|
||||
pub const Dependency = struct {
|
||||
url: []const u8,
|
||||
hash: ?[]const u8,
|
||||
};
|
||||
|
||||
pub fn deinit(self: *Package) void {
|
||||
if (self.root_src_directory_owned)
|
||||
self.root_src_directory.closeAndFree(self.allocator);
|
||||
}
|
||||
|
||||
pub fn fetchOneAndUnpack(
|
||||
allocator: std.mem.Allocator,
|
||||
cache_directory: []const u8, // directory to store things
|
||||
dep: Dependency, // thing to download
|
||||
) !*Package {
|
||||
var http_client: std.http.Client = .{ .allocator = allocator };
|
||||
defer http_client.deinit();
|
||||
|
||||
var global_cache_directory: std.Build.Cache.Directory = .{
|
||||
.handle = try std.fs.cwd().makeOpenPath(cache_directory, .{}),
|
||||
.path = cache_directory,
|
||||
};
|
||||
var thread_pool: std.Thread.Pool = undefined;
|
||||
try thread_pool.init(.{ .allocator = allocator });
|
||||
defer thread_pool.deinit();
|
||||
var progress: std.Progress = .{ .dont_print_on_dumb = true };
|
||||
const root_prog_node = progress.start("Fetch Packages", 0);
|
||||
defer root_prog_node.end();
|
||||
return try fetchAndUnpack(
|
||||
&thread_pool,
|
||||
&http_client,
|
||||
global_cache_directory,
|
||||
dep,
|
||||
dep.url,
|
||||
root_prog_node,
|
||||
);
|
||||
}
|
||||
|
||||
pub fn fetchAndUnpack(
|
||||
thread_pool: *std.Thread.Pool, // thread pool for hashing things in parallel
|
||||
http_client: *std.http.Client, // client to download stuff
|
||||
global_cache_directory: std.Build.Cache.Directory, // directory to store things
|
||||
dep: Dependency, // thing to download
|
||||
fqn: []const u8, // used as name for thing downloaded
|
||||
root_prog_node: *std.Progress.Node, // used for outputting to terminal
|
||||
) !*Package {
|
||||
const gpa = http_client.allocator;
|
||||
const s = std.fs.path.sep_str;
|
||||
|
||||
// Check if the expected_hash is already present in the global package
|
||||
// cache, and thereby avoid both fetching and unpacking.
|
||||
if (dep.hash) |h| cached: {
|
||||
const hex_digest = h[0..Hasher.hex_multihash_len];
|
||||
const pkg_dir_sub_path = "p" ++ s ++ hex_digest;
|
||||
|
||||
const build_root = try global_cache_directory.join(gpa, &.{pkg_dir_sub_path});
|
||||
errdefer gpa.free(build_root);
|
||||
|
||||
var pkg_dir = global_cache_directory.handle.openDir(pkg_dir_sub_path, .{}) catch |err| switch (err) {
|
||||
error.FileNotFound => break :cached,
|
||||
else => |e| return e,
|
||||
};
|
||||
errdefer pkg_dir.close();
|
||||
|
||||
root_prog_node.completeOne();
|
||||
|
||||
const ptr = try gpa.create(Package);
|
||||
errdefer gpa.destroy(ptr);
|
||||
|
||||
ptr.* = .{
|
||||
.root_src_directory = .{
|
||||
.path = build_root, // TODO: This leaks memory somehow (should be cleaned in deinit()
|
||||
.handle = pkg_dir,
|
||||
},
|
||||
.root_src_directory_owned = true,
|
||||
.allocator = gpa,
|
||||
};
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
var pkg_prog_node = root_prog_node.start(fqn, 0);
|
||||
defer pkg_prog_node.end();
|
||||
pkg_prog_node.activate();
|
||||
pkg_prog_node.context.refresh();
|
||||
|
||||
const uri = try std.Uri.parse(dep.url);
|
||||
|
||||
const rand_int = std.crypto.random.int(u64);
|
||||
const tmp_dir_sub_path = "tmp" ++ s ++ Hasher.hex64(rand_int);
|
||||
|
||||
const actual_hash = a: {
|
||||
var tmp_directory: std.Build.Cache.Directory = d: {
|
||||
const path = try global_cache_directory.join(gpa, &.{tmp_dir_sub_path});
|
||||
errdefer gpa.free(path);
|
||||
|
||||
const iterable_dir = try global_cache_directory.handle.makeOpenPathIterable(tmp_dir_sub_path, .{});
|
||||
errdefer iterable_dir.close();
|
||||
|
||||
break :d .{
|
||||
.path = path,
|
||||
.handle = iterable_dir.dir,
|
||||
};
|
||||
};
|
||||
defer tmp_directory.closeAndFree(gpa);
|
||||
|
||||
var h = std.http.Headers{ .allocator = gpa };
|
||||
defer h.deinit();
|
||||
|
||||
var req = try http_client.request(.GET, uri, h, .{});
|
||||
defer req.deinit();
|
||||
|
||||
try req.start();
|
||||
try req.wait();
|
||||
|
||||
if (req.response.status != .ok) {
|
||||
std.log.err("Expected response status '200 OK' got '{} {s}'", .{
|
||||
@intFromEnum(req.response.status),
|
||||
req.response.status.phrase() orelse "",
|
||||
});
|
||||
return error.UnexpectedResponseStatus;
|
||||
}
|
||||
|
||||
const content_type = req.response.headers.getFirstValue("Content-Type") orelse
|
||||
return error.MissingContentTypeHeader;
|
||||
|
||||
var prog_reader: ProgressReader(std.http.Client.Request.Reader) = .{
|
||||
.child_reader = req.reader(),
|
||||
.prog_node = &pkg_prog_node,
|
||||
.unit = if (req.response.content_length) |content_length| unit: {
|
||||
const kib = content_length / 1024;
|
||||
const mib = kib / 1024;
|
||||
if (mib > 0) {
|
||||
pkg_prog_node.setEstimatedTotalItems(@intCast(mib));
|
||||
pkg_prog_node.setUnit("MiB");
|
||||
break :unit .mib;
|
||||
} else {
|
||||
pkg_prog_node.setEstimatedTotalItems(@intCast(@max(1, kib)));
|
||||
pkg_prog_node.setUnit("KiB");
|
||||
break :unit .kib;
|
||||
}
|
||||
} else .any,
|
||||
};
|
||||
pkg_prog_node.context.refresh();
|
||||
|
||||
if (std.ascii.eqlIgnoreCase(content_type, "application/gzip") or
|
||||
std.ascii.eqlIgnoreCase(content_type, "application/x-gzip") or
|
||||
std.ascii.eqlIgnoreCase(content_type, "application/tar+gzip"))
|
||||
{
|
||||
// I observed the gzip stream to read 1 byte at a time, so I am using a
|
||||
// buffered reader on the front of it.
|
||||
try unpackTarball(gpa, prog_reader.reader(), tmp_directory.handle, std.compress.gzip);
|
||||
} else if (std.ascii.eqlIgnoreCase(content_type, "application/x-xz")) {
|
||||
// I have not checked what buffer sizes the xz decompression implementation uses
|
||||
// by default, so the same logic applies for buffering the reader as for gzip.
|
||||
try unpackTarball(gpa, prog_reader.reader(), tmp_directory.handle, std.compress.xz);
|
||||
} else if (std.ascii.eqlIgnoreCase(content_type, "application/octet-stream")) {
|
||||
// support gitlab tarball urls such as https://gitlab.com/<namespace>/<project>/-/archive/<sha>/<project>-<sha>.tar.gz
|
||||
// whose content-disposition header is: 'attachment; filename="<project>-<sha>.tar.gz"'
|
||||
const content_disposition = req.response.headers.getFirstValue("Content-Disposition") orelse
|
||||
return error.@"Missing 'Content-Disposition' header for Content-Type=application/octet-stream";
|
||||
if (isTarAttachment(content_disposition)) {
|
||||
try unpackTarball(gpa, prog_reader.reader(), tmp_directory.handle, std.compress.gzip);
|
||||
} else {
|
||||
std.log.err("Unsupported 'Content-Disposition' header value: '{s}' for Content-Type=application/octet-stream", .{content_disposition});
|
||||
return error.UnsupportedContentDispositionHeader;
|
||||
}
|
||||
} else {
|
||||
std.log.err("Unsupported 'Content-Type' header value: '{s}'", .{content_type});
|
||||
return error.UnsupportedContentTypeHeader;
|
||||
}
|
||||
|
||||
// Download completed - stop showing downloaded amount as progress
|
||||
pkg_prog_node.setEstimatedTotalItems(0);
|
||||
pkg_prog_node.setCompletedItems(0);
|
||||
pkg_prog_node.context.refresh();
|
||||
|
||||
// TODO: delete files not included in the package prior to computing the package hash.
|
||||
// for example, if the ini file has directives to include/not include certain files,
|
||||
// apply those rules directly to the filesystem right here. This ensures that files
|
||||
// not protected by the hash are not present on the file system.
|
||||
|
||||
// TODO: raise an error for files that have illegal paths on some operating systems.
|
||||
// For example, on Linux a path with a backslash should raise an error here.
|
||||
// Of course, if the ignore rules above omit the file from the package, then everything
|
||||
// is fine and no error should be raised.
|
||||
|
||||
break :a try Hasher.computeDirectoryHash(thread_pool, .{ .dir = tmp_directory.handle }, &.{});
|
||||
};
|
||||
|
||||
const pkg_dir_sub_path = "p" ++ s ++ Hasher.hexDigest(actual_hash);
|
||||
try renameTmpIntoCache(global_cache_directory.handle, tmp_dir_sub_path, pkg_dir_sub_path);
|
||||
|
||||
const actual_hex = Hasher.hexDigest(actual_hash);
|
||||
if (dep.hash) |h| {
|
||||
if (!std.mem.eql(u8, h, &actual_hex)) {
|
||||
std.log.err("hash mismatch: expected: {s}, found: {s}", .{
|
||||
h, actual_hex,
|
||||
});
|
||||
return error.HashMismatch;
|
||||
}
|
||||
} else {
|
||||
std.log.err("No hash supplied. Expecting hash \"{s}\"", .{actual_hex});
|
||||
return error.NoHashSupplied;
|
||||
}
|
||||
|
||||
const build_root = try global_cache_directory.join(gpa, &.{pkg_dir_sub_path});
|
||||
defer gpa.free(build_root);
|
||||
|
||||
const mod = try createWithDir(gpa, global_cache_directory, pkg_dir_sub_path);
|
||||
return mod;
|
||||
}
|
||||
fn ProgressReader(comptime ReaderType: type) type {
|
||||
return struct {
|
||||
child_reader: ReaderType,
|
||||
bytes_read: u64 = 0,
|
||||
prog_node: *std.Progress.Node,
|
||||
unit: enum {
|
||||
kib,
|
||||
mib,
|
||||
any,
|
||||
},
|
||||
|
||||
pub const Error = ReaderType.Error;
|
||||
pub const Reader = std.io.Reader(*@This(), Error, read);
|
||||
|
||||
pub fn read(self: *@This(), buf: []u8) Error!usize {
|
||||
const amt = try self.child_reader.read(buf);
|
||||
self.bytes_read += amt;
|
||||
const kib = self.bytes_read / 1024;
|
||||
const mib = kib / 1024;
|
||||
switch (self.unit) {
|
||||
.kib => self.prog_node.setCompletedItems(@intCast(kib)),
|
||||
.mib => self.prog_node.setCompletedItems(@intCast(mib)),
|
||||
.any => {
|
||||
if (mib > 0) {
|
||||
self.prog_node.setUnit("MiB");
|
||||
self.prog_node.setCompletedItems(@intCast(mib));
|
||||
} else {
|
||||
self.prog_node.setUnit("KiB");
|
||||
self.prog_node.setCompletedItems(@intCast(kib));
|
||||
}
|
||||
},
|
||||
}
|
||||
self.prog_node.context.maybeRefresh();
|
||||
return amt;
|
||||
}
|
||||
|
||||
pub fn reader(self: *@This()) Reader {
|
||||
return .{ .context = self };
|
||||
}
|
||||
};
|
||||
}
|
||||
fn isTarAttachment(content_disposition: []const u8) bool {
|
||||
const disposition_type_end = std.ascii.indexOfIgnoreCase(content_disposition, "attachment;") orelse return false;
|
||||
|
||||
var value_start = std.ascii.indexOfIgnoreCasePos(content_disposition, disposition_type_end + 1, "filename") orelse return false;
|
||||
value_start += "filename".len;
|
||||
if (content_disposition[value_start] == '*') {
|
||||
value_start += 1;
|
||||
}
|
||||
if (content_disposition[value_start] != '=') return false;
|
||||
value_start += 1;
|
||||
|
||||
var value_end = std.mem.indexOfPos(u8, content_disposition, value_start, ";") orelse content_disposition.len;
|
||||
if (content_disposition[value_end - 1] == '\"') {
|
||||
value_end -= 1;
|
||||
}
|
||||
return std.ascii.endsWithIgnoreCase(content_disposition[value_start..value_end], ".tar.gz");
|
||||
}
|
||||
fn renameTmpIntoCache(
|
||||
cache_dir: std.fs.Dir,
|
||||
tmp_dir_sub_path: []const u8,
|
||||
dest_dir_sub_path: []const u8,
|
||||
) !void {
|
||||
std.debug.assert(dest_dir_sub_path[1] == std.fs.path.sep);
|
||||
var handled_missing_dir = false;
|
||||
while (true) {
|
||||
cache_dir.rename(tmp_dir_sub_path, dest_dir_sub_path) catch |err| switch (err) {
|
||||
error.FileNotFound => {
|
||||
if (handled_missing_dir) return err;
|
||||
cache_dir.makeDir(dest_dir_sub_path[0..1]) catch |mkd_err| switch (mkd_err) {
|
||||
error.PathAlreadyExists => handled_missing_dir = true,
|
||||
else => |e| return e,
|
||||
};
|
||||
continue;
|
||||
},
|
||||
error.PathAlreadyExists, error.AccessDenied => {
|
||||
// Package has been already downloaded and may already be in use on the system.
|
||||
cache_dir.deleteTree(tmp_dir_sub_path) catch |del_err| {
|
||||
std.log.warn("unable to delete temp directory: {s}", .{@errorName(del_err)});
|
||||
};
|
||||
},
|
||||
else => |e| return e,
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fn createWithDir(
|
||||
gpa: std.mem.Allocator,
|
||||
directory: std.Build.Cache.Directory,
|
||||
/// Relative to `directory`. If null, means `directory` is the root src dir
|
||||
/// and is owned externally.
|
||||
root_src_dir_path: ?[]const u8,
|
||||
) !*Package {
|
||||
const ptr = try gpa.create(Package);
|
||||
errdefer gpa.destroy(ptr);
|
||||
|
||||
if (root_src_dir_path) |p| {
|
||||
const owned_dir_path = try directory.join(gpa, &[1][]const u8{p});
|
||||
errdefer gpa.free(owned_dir_path);
|
||||
|
||||
ptr.* = .{
|
||||
.root_src_directory = .{
|
||||
.path = owned_dir_path,
|
||||
.handle = try directory.handle.openDir(p, .{}),
|
||||
},
|
||||
.root_src_directory_owned = true,
|
||||
.allocator = gpa,
|
||||
};
|
||||
} else {
|
||||
ptr.* = .{
|
||||
.root_src_directory = directory,
|
||||
.root_src_directory_owned = false,
|
||||
.allocator = gpa,
|
||||
};
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
// Create/Write a file, close it, then grab its stat.mtime timestamp.
|
||||
fn testGetCurrentFileTimestamp(dir: std.fs.Dir) !i128 {
|
||||
const test_out_file = "test-filetimestamp.tmp";
|
||||
|
||||
var file = try dir.createFile(test_out_file, .{
|
||||
.read = true,
|
||||
.truncate = true,
|
||||
});
|
||||
defer {
|
||||
file.close();
|
||||
dir.deleteFile(test_out_file) catch {};
|
||||
}
|
||||
|
||||
return (try file.stat()).mtime;
|
||||
}
|
||||
|
||||
// These functions come from src/Package.zig, src/Manifest.zig in the compiler,
|
||||
// not the standard library
|
||||
fn unpackTarball(
|
||||
gpa: std.mem.Allocator,
|
||||
req_reader: anytype,
|
||||
out_dir: std.fs.Dir,
|
||||
comptime compression: type,
|
||||
) !void {
|
||||
var br = std.io.bufferedReaderSize(std.crypto.tls.max_ciphertext_record_len, req_reader);
|
||||
|
||||
var decompress = try compression.decompress(gpa, br.reader());
|
||||
defer decompress.deinit();
|
||||
|
||||
try std.tar.pipeToFileSystem(out_dir, decompress.reader(), .{
|
||||
.strip_components = 1,
|
||||
// TODO: we would like to set this to executable_bit_only, but two
|
||||
// things need to happen before that:
|
||||
// 1. the tar implementation needs to support it
|
||||
// 2. the hashing algorithm here needs to support detecting the is_executable
|
||||
// bit on Windows from the ACLs (see the isExecutable function).
|
||||
.mode_mode = .ignore,
|
||||
});
|
||||
}
|
||||
|
||||
test {
|
||||
std.testing.refAllDecls(@This());
|
||||
}
|
||||
test "cache a file and recall it" {
|
||||
if (builtin.os.tag == .wasi) {
|
||||
// https://github.com/ziglang/zig/issues/5437
|
||||
|
||||
return error.SkipZigTest;
|
||||
}
|
||||
|
||||
var tmp = testing.tmpDir(.{});
|
||||
defer tmp.cleanup();
|
||||
|
||||
const temp_file = "test.txt";
|
||||
const temp_file2 = "test2.txt";
|
||||
const temp_manifest_dir = "temp_manifest_dir";
|
||||
|
||||
try tmp.dir.writeFile(temp_file, "Hello, world!\n");
|
||||
try tmp.dir.writeFile(temp_file2, "yo mamma\n");
|
||||
|
||||
// Wait for file timestamps to tick
|
||||
|
||||
const initial_time = try testGetCurrentFileTimestamp(tmp.dir);
|
||||
while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {
|
||||
std.time.sleep(1);
|
||||
}
|
||||
|
||||
var digest1: [hex_digest_len]u8 = undefined;
|
||||
var digest2: [hex_digest_len]u8 = undefined;
|
||||
|
||||
{
|
||||
var cache = std.build.Cache{
|
||||
.gpa = testing.allocator,
|
||||
.manifest_dir = try tmp.dir.makeOpenPath(temp_manifest_dir, .{}),
|
||||
};
|
||||
cache.addPrefix(.{ .path = null, .handle = tmp.dir });
|
||||
defer cache.manifest_dir.close();
|
||||
|
||||
{
|
||||
var ch = cache.obtain();
|
||||
defer ch.deinit();
|
||||
|
||||
ch.hash.add(true);
|
||||
ch.hash.add(@as(u16, 1234));
|
||||
ch.hash.addBytes("1234");
|
||||
_ = try ch.addFile(temp_file, null);
|
||||
|
||||
// There should be nothing in the cache
|
||||
|
||||
try testing.expectEqual(false, try ch.hit());
|
||||
|
||||
digest1 = ch.final();
|
||||
try ch.writeManifest();
|
||||
}
|
||||
{
|
||||
var ch = cache.obtain();
|
||||
defer ch.deinit();
|
||||
|
||||
ch.hash.add(true);
|
||||
ch.hash.add(@as(u16, 1234));
|
||||
ch.hash.addBytes("1234");
|
||||
_ = try ch.addFile(temp_file, null);
|
||||
|
||||
// Cache hit! We just "built" the same file
|
||||
|
||||
try testing.expect(try ch.hit());
|
||||
digest2 = ch.final();
|
||||
|
||||
try testing.expectEqual(false, ch.have_exclusive_lock);
|
||||
}
|
||||
|
||||
try testing.expectEqual(digest1, digest2);
|
||||
}
|
||||
}
|
||||
test "fetch and unpack" {
|
||||
const alloc = std.testing.allocator;
|
||||
var http_client: std.http.Client = .{ .allocator = alloc };
|
||||
defer http_client.deinit();
|
||||
|
||||
var global_cache_directory: std.Build.Cache.Directory = .{
|
||||
.handle = try std.fs.cwd().makeOpenPath("test-pkg", .{}),
|
||||
.path = "test-pkg",
|
||||
};
|
||||
var thread_pool: std.Thread.Pool = undefined;
|
||||
try thread_pool.init(.{ .allocator = alloc });
|
||||
defer thread_pool.deinit();
|
||||
var progress: std.Progress = .{ .dont_print_on_dumb = true };
|
||||
const root_prog_node = progress.start("Fetch Packages", 0);
|
||||
defer root_prog_node.end();
|
||||
const pkg = try fetchAndUnpack(
|
||||
&thread_pool,
|
||||
&http_client,
|
||||
global_cache_directory,
|
||||
.{
|
||||
.url = "https://github.com/aws/aws-sdk-go-v2/archive/7502ff360b1c3b79cbe117437327f6ff5fb89f65.tar.gz",
|
||||
.hash = "1220a414719bff14c9362fb1c695e3346fa12ec2e728bae5757a57aae7738916ffd2",
|
||||
},
|
||||
"https://github.com/aws/aws-sdk-go-v2/archive/7502ff360b1c3b79cbe117437327f6ff5fb89f65.tar.gz",
|
||||
root_prog_node,
|
||||
);
|
||||
defer alloc.destroy(pkg);
|
||||
defer pkg.deinit();
|
||||
}
|
||||
test "fetch one and unpack" {
|
||||
const pkg = try fetchOneAndUnpack(
|
||||
std.testing.allocator,
|
||||
"test-pkg",
|
||||
.{
|
||||
.url = "https://github.com/aws/aws-sdk-go-v2/archive/7502ff360b1c3b79cbe117437327f6ff5fb89f65.tar.gz",
|
||||
.hash = "1220a414719bff14c9362fb1c695e3346fa12ec2e728bae5757a57aae7738916ffd2",
|
||||
},
|
||||
);
|
||||
defer std.testing.allocator.destroy(pkg);
|
||||
defer pkg.deinit();
|
||||
try std.testing.expectEqualStrings(
|
||||
"test-pkg/p/1220a414719bff14c9362fb1c695e3346fa12ec2e728bae5757a57aae7738916ffd2",
|
||||
pkg.root_src_directory.path.?,
|
||||
);
|
||||
}
|
||||
test "isTarAttachment" {
|
||||
try std.testing.expect(isTarAttachment("attaChment; FILENAME=\"stuff.tar.gz\"; size=42"));
|
||||
try std.testing.expect(isTarAttachment("attachment; filename*=\"stuff.tar.gz\""));
|
||||
try std.testing.expect(isTarAttachment("ATTACHMENT; filename=\"stuff.tar.gz\""));
|
||||
try std.testing.expect(isTarAttachment("attachment; FileName=\"stuff.tar.gz\""));
|
||||
try std.testing.expect(isTarAttachment("attachment; FileName*=UTF-8\'\'xyz%2Fstuff.tar.gz"));
|
||||
|
||||
try std.testing.expect(!isTarAttachment("attachment FileName=\"stuff.tar.gz\""));
|
||||
try std.testing.expect(!isTarAttachment("attachment; FileName=\"stuff.tar\""));
|
||||
try std.testing.expect(!isTarAttachment("attachment; FileName\"stuff.gz\""));
|
||||
try std.testing.expect(!isTarAttachment("attachment; size=42"));
|
||||
try std.testing.expect(!isTarAttachment("inline; size=42"));
|
||||
try std.testing.expect(!isTarAttachment("FileName=\"stuff.tar.gz\"; attachment;"));
|
||||
try std.testing.expect(!isTarAttachment("FileName=\"stuff.tar.gz\";"));
|
||||
}
|
52
README.md
52
README.md
|
@ -3,12 +3,8 @@ AWS SDK for Zig
|
|||
|
||||
[![Build Status](https://actions-status.lerch.org/lobo/aws-sdk-for-zig/build)](https://git.lerch.org/lobo/aws-sdk-for-zig/actions?workflow=build.yaml&state=closed)
|
||||
|
||||
**Now that 0.11 has been released, work will commence to move to the new compiler**
|
||||
|
||||
Current executable size for the demo is 1.7M (90k of which is the AWS PEM file,
|
||||
and approximately 600K for XML services) after compiling with -Drelease-safe and
|
||||
[stripping the executable after compilation](https://github.com/ziglang/zig/issues/351).
|
||||
This is for x86_linux, and will vary based on services used. Tested targets:
|
||||
Current executable size for the demo is 980k after compiling with -Doptimize=ReleaseSmall
|
||||
in x86_linux, and will vary based on services used. Tested targets:
|
||||
|
||||
* x86_64-linux
|
||||
* riscv64-linux
|
||||
|
@ -23,14 +19,25 @@ Tested targets are built, but not continuously tested, by CI.
|
|||
Building
|
||||
--------
|
||||
|
||||
`zig build` should work. It will build the code generation project, run
|
||||
the code generation, then build the main project with the generated code.
|
||||
`zig build` should work. It will build the code generation project, fetch model
|
||||
files from upstream AWS Go SDK v2, run the code generation, then build the main
|
||||
project with the generated code. Testing can be done with `zig test`.
|
||||
|
||||
First time build should use `zig build -Dfetch` to fetch dependent packages
|
||||
(zfetch and friends).
|
||||
Note that there are some loose ends on this version as compared to the [0.9.0
|
||||
branch](https://git.lerch.org/lobo/aws-sdk-for-zig/src/branch/0.9.0). More
|
||||
details below in Limitations. This branch overall is superior, as is the 0.11
|
||||
compiler, but if you need an edge case and don't want to issue a PR, feel free
|
||||
to use that branch.
|
||||
|
||||
Running
|
||||
-------
|
||||
Using
|
||||
-----
|
||||
|
||||
This is designed for use with the Zig 0.11 package manager, and exposes a module
|
||||
called "aws". Set up `build.zig.zon` and add the dependency/module to your project
|
||||
as normal and the package manager should do its thing.
|
||||
|
||||
Running the demo
|
||||
----------------
|
||||
|
||||
This library mimics the aws c libraries for it's work, so it operates like most
|
||||
other 'AWS things'. main.zig gives you a handful of examples for working with services.
|
||||
|
@ -40,8 +47,10 @@ supersede all other configuration. Note that an alternative endpoint may
|
|||
require passing in a client option to specify an different TLS root certificate
|
||||
(pass null to disable certificate verification).
|
||||
|
||||
The [old branch](https://github.com/elerch/aws-sdk-for-zig/tree/aws-crt) exists
|
||||
for posterity, and supports x86_64 linux. The old branch is deprecated.
|
||||
An [old branch based on aws-crt](https://github.com/elerch/aws-sdk-for-zig/tree/aws-crt) exists
|
||||
for posterity, and supports x86_64 linux. The old branch is deprecated, so if
|
||||
there are issues you see that work correctly in the aws-crt branch, please
|
||||
file an issue.
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
|
@ -50,12 +59,23 @@ WebIdentityToken is not yet implemented.
|
|||
|
||||
TODO List:
|
||||
|
||||
* Bump to zig 0.11 and replace zFetch with [std.http.Client](https://github.com/ziglang/zig/blob/master/lib/std/http/Client.zig)
|
||||
* re-enable all demos. Some are causing compilation errors, and these errors
|
||||
do not have reference tracing as they exist within monomorphised code
|
||||
* Implement all demos as tests in src/aws.zig. This has been done for
|
||||
STS GetCallerIdentity, but needs to be extended for the others
|
||||
* Json parsing is based on a fork of the 0.9.0 (maybe earlier?) json parser.
|
||||
Upgrading to 0.11 caused some commenting of things that probably broke some
|
||||
stuff. JSON parsing in general needs a re-visit. Note also that a json.zig
|
||||
file is embedded/copied from the codegen project, so that also needs a second
|
||||
look.
|
||||
* Take a look to see about compilation speed. With codegen caching this is
|
||||
reasonable, but still takes longer than needed.
|
||||
* Upgrade the model files. This is a simple tasks, but I'd like the first
|
||||
item on this list to be completed first.
|
||||
* Implement sigv4a signing
|
||||
* Implement jitter/exponential backoff
|
||||
* Implement timeouts and other TODO's in the code
|
||||
* Add option to cache signature keys
|
||||
* Move CI to github actions based on [gittea's implementation](https://blog.gitea.io/2022/12/feature-preview-gitea-actions/)
|
||||
|
||||
Compiler wishlist/watchlist:
|
||||
|
||||
|
|
229
VersionStep.zig
229
VersionStep.zig
|
@ -1,229 +0,0 @@
|
|||
//! Publish Date: 2022-01-12
|
||||
//! This file is hosted at ??? and is meant to be copied
|
||||
//! to projects that use it. Sample usage:
|
||||
//!
|
||||
//! const version = VersionStep.create(b, null);
|
||||
//! exe.step.dependOn(&version.step);
|
||||
|
||||
const std = @import("std");
|
||||
const Step = @This();
|
||||
|
||||
step: std.build.Step,
|
||||
builder: *std.build.Builder,
|
||||
version_path: []const u8,
|
||||
|
||||
// Creates a step that will add the git version info in a file in src/
|
||||
// so it can be consumed by additional code. If version_path is not specified,
|
||||
// it will default to "git_version.zig". This should be part of .gitignore
|
||||
pub fn create(b: *std.build.Builder, version_path: ?[]const u8) *Step {
|
||||
var result = b.allocator.create(Step) catch @panic("memory");
|
||||
result.* = Step{
|
||||
.step = std.build.Step.init(.custom, "create version file", b.allocator, make),
|
||||
.builder = b,
|
||||
.version_path = std.fs.path.resolve(b.allocator, &[_][]const u8{
|
||||
b.build_root,
|
||||
"src",
|
||||
version_path orelse "git_version.zig",
|
||||
}) catch @panic("memory"),
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
fn make(step: *std.build.Step) !void {
|
||||
const self = @fieldParentPtr(Step, "step", step);
|
||||
const file = try std.fs.createFileAbsolute(self.version_path, .{});
|
||||
defer file.close();
|
||||
const version = try getGitVersion(
|
||||
self.builder.allocator,
|
||||
self.builder.build_root,
|
||||
self.builder.env_map,
|
||||
);
|
||||
defer version.deinit();
|
||||
try file.writer().print(
|
||||
\\pub const hash = "{s}";
|
||||
\\pub const abbreviated_hash = "{s}";
|
||||
\\pub const commit_date = "{s}";
|
||||
\\pub const branch = "{s}";
|
||||
\\pub const dirty = {b};
|
||||
\\pub const pretty_version = "{s}";
|
||||
, .{
|
||||
version.hash,
|
||||
version.abbreviated_hash,
|
||||
version.commit_date,
|
||||
version.branch,
|
||||
version.dirty,
|
||||
version.pretty_version,
|
||||
});
|
||||
}
|
||||
|
||||
const GitVersion = struct {
|
||||
hash: []const u8,
|
||||
abbreviated_hash: []const u8,
|
||||
commit_date: []const u8,
|
||||
branch: []const u8,
|
||||
dirty: bool,
|
||||
pretty_version: []const u8,
|
||||
|
||||
allocator: std.mem.Allocator,
|
||||
|
||||
const Self = @This();
|
||||
|
||||
pub fn deinit(self: Self) void {
|
||||
self.allocator.free(self.hash);
|
||||
self.allocator.free(self.abbreviated_hash);
|
||||
self.allocator.free(self.commit_date);
|
||||
self.allocator.free(self.branch);
|
||||
self.allocator.free(self.pretty_version);
|
||||
}
|
||||
};
|
||||
|
||||
fn getGitVersion(allocator: std.mem.Allocator, git_working_root: ?[]const u8, env: anytype) !GitVersion {
|
||||
// git log -1 --pretty="%H%n%h%n%ci%n%D"
|
||||
// 3bf6adc13e4aa653a7b75b1b5e9c9db5215df8e1
|
||||
// 3bf6adc
|
||||
// 2022-01-12 12:21:28 -0800
|
||||
// HEAD -> zig-native
|
||||
|
||||
const log_output = run(
|
||||
allocator,
|
||||
&[_][]const u8{
|
||||
"git",
|
||||
"log",
|
||||
"-1",
|
||||
"--pretty=%H%n%h%n%ci%n%D",
|
||||
},
|
||||
git_working_root,
|
||||
env,
|
||||
) catch |e| {
|
||||
if (std.os.getenv("DRONE_COMMIT_SHA") != null)
|
||||
return getGitVersionFromDrone(allocator);
|
||||
return e;
|
||||
};
|
||||
defer allocator.free(log_output);
|
||||
const line_data = try getLines(allocator, 4, log_output);
|
||||
const hash = line_data[0];
|
||||
const abbrev_hash = line_data[1];
|
||||
const date = line_data[2];
|
||||
const branch = line_data[3];
|
||||
|
||||
// git status --porcelain
|
||||
const status_output = try run(
|
||||
allocator,
|
||||
&[_][]const u8{
|
||||
"git",
|
||||
"status",
|
||||
"--porcelain",
|
||||
},
|
||||
git_working_root,
|
||||
env,
|
||||
);
|
||||
const dirty = blk: {
|
||||
if (status_output.len > 0) {
|
||||
allocator.free(status_output);
|
||||
break :blk true;
|
||||
}
|
||||
break :blk false;
|
||||
};
|
||||
const dirty_str = blk: {
|
||||
if (dirty) {
|
||||
break :blk " (dirty)";
|
||||
}
|
||||
break :blk "";
|
||||
};
|
||||
|
||||
return GitVersion{
|
||||
.hash = hash,
|
||||
.abbreviated_hash = abbrev_hash,
|
||||
.commit_date = date,
|
||||
.branch = branch,
|
||||
.allocator = allocator,
|
||||
.dirty = dirty,
|
||||
.pretty_version = try prettyVersion(allocator, abbrev_hash, date, dirty_str),
|
||||
};
|
||||
}
|
||||
fn prettyVersion(allocator: std.mem.Allocator, abbrev_hash: []const u8, date: []const u8, dirty_str: []const u8) ![]const u8 {
|
||||
const pretty_version: []const u8 = try std.fmt.allocPrint(
|
||||
allocator,
|
||||
"version {s}, committed at {s}{s}",
|
||||
.{
|
||||
abbrev_hash,
|
||||
date,
|
||||
dirty_str,
|
||||
},
|
||||
);
|
||||
return pretty_version;
|
||||
}
|
||||
|
||||
fn getGitVersionFromDrone(allocator: std.mem.Allocator) !GitVersion {
|
||||
const abbrev_hash = std.os.getenv("DRONE_COMMIT_SHA").?[0..7]; // This isn't quite how git works, but ok
|
||||
const date = std.os.getenv("DRONE_BUILD_STARTED").?; // this is a timestamp :(
|
||||
return GitVersion{
|
||||
.hash = std.os.getenv("DRONE_COMMIT_SHA").?,
|
||||
.abbreviated_hash = abbrev_hash,
|
||||
.commit_date = date,
|
||||
.branch = std.os.getenv("DRONE_COMMIT_BRANCH").?,
|
||||
.allocator = allocator,
|
||||
.dirty = false,
|
||||
.pretty_version = try prettyVersion(allocator, abbrev_hash, date, ""),
|
||||
};
|
||||
}
|
||||
fn getLines(allocator: std.mem.Allocator, comptime line_count: u32, data: []const u8) ![line_count][]u8 {
|
||||
var line: u32 = 0;
|
||||
var start: u32 = 0;
|
||||
var current: u32 = 0;
|
||||
var line_data: [line_count][]u8 = undefined;
|
||||
errdefer {
|
||||
while (line > 0) {
|
||||
allocator.free(line_data[line]);
|
||||
line -= 1;
|
||||
}
|
||||
}
|
||||
for (data) |c| {
|
||||
// try std.io.getStdErr().writer().print("line: {d}, c: {c}, cur: {d}, strt: {d}\n", .{ line, c, current, start });
|
||||
if (c == '\n') {
|
||||
line_data[line] = try allocator.dupe(u8, data[start..current]);
|
||||
// try std.io.getStdErr().writer().print("c: {d}, s: {d}, data: '{s}'\n", .{ current, start, line_data[line] });
|
||||
start = current + 1;
|
||||
line += 1;
|
||||
}
|
||||
current += 1;
|
||||
}
|
||||
return line_data;
|
||||
}
|
||||
|
||||
// env is a std.process.BufMap, but that's private, which is a little weird tbh
|
||||
fn run(allocator: std.mem.Allocator, argv: []const []const u8, cwd: ?[]const u8, env: anytype) ![]const u8 {
|
||||
{
|
||||
var msg = std.ArrayList(u8).init(allocator);
|
||||
defer msg.deinit();
|
||||
const writer = msg.writer();
|
||||
var prefix: []const u8 = "";
|
||||
for (argv) |arg| {
|
||||
try writer.print("{s}\"{s}\"", .{ prefix, arg });
|
||||
prefix = " ";
|
||||
}
|
||||
// std.log.debug("[RUN] {s}", .{msg.items});
|
||||
}
|
||||
|
||||
const result = try std.ChildProcess.exec(.{
|
||||
.allocator = allocator,
|
||||
.argv = argv,
|
||||
.cwd = cwd,
|
||||
.env_map = env,
|
||||
});
|
||||
defer if (result.stderr.len > 0) allocator.free(result.stderr);
|
||||
try std.io.getStdErr().writer().writeAll(result.stderr);
|
||||
|
||||
switch (result.term) {
|
||||
.Exited => |code| if (code != 0) {
|
||||
std.log.err("process failed with exit code: {}", .{code});
|
||||
|
||||
std.os.exit(0xff);
|
||||
},
|
||||
else => {
|
||||
std.log.err("process failed due to exception: {}", .{result});
|
||||
std.os.exit(0xff);
|
||||
},
|
||||
}
|
||||
return result.stdout;
|
||||
}
|
260
build.zig
260
build.zig
|
@ -1,18 +1,14 @@
|
|||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const Builder = @import("std").build.Builder;
|
||||
const GitRepoStep = @import("GitRepoStep.zig");
|
||||
const CopyStep = @import("CopyStep.zig");
|
||||
const tst = @import("build_test.zig");
|
||||
const VersionStep = @import("VersionStep.zig");
|
||||
const Package = @import("Package.zig");
|
||||
|
||||
const models_url = "https://github.com/aws/aws-sdk-go-v2/archive/7502ff360b1c3b79cbe117437327f6ff5fb89f65.tar.gz";
|
||||
const models_hash: ?[]const u8 = "1220a414719bff14c9362fb1c695e3346fa12ec2e728bae5757a57aae7738916ffd2";
|
||||
const models_subdir = "codegen/sdk-codegen/aws-models/"; // note will probably not work on windows
|
||||
const models_dir = "p" ++ std.fs.path.sep_str ++ (models_hash orelse "") ++ std.fs.path.sep_str ++ models_subdir;
|
||||
|
||||
pub fn build(b: *Builder) !void {
|
||||
const zfetch_repo = GitRepoStep.create(b, .{
|
||||
.url = "https://github.com/truemedian/zfetch",
|
||||
// .branch = "0.1.10", // branch also takes tags. Tag 0.1.10 isn't quite new enough
|
||||
.sha = "271cab5da4d12c8f08e67aa0cd5268da100e52f1",
|
||||
});
|
||||
|
||||
// Standard target options allows the person running `zig build` to choose
|
||||
// what target to build for. Here we do not override the defaults, which
|
||||
// means any target is allowed, and the default is native. Other options
|
||||
|
@ -21,41 +17,49 @@ pub fn build(b: *Builder) !void {
|
|||
|
||||
// Standard release options allow the person running `zig build` to select
|
||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
||||
const mode = b.standardReleaseOptions();
|
||||
const exe = b.addExecutable("demo", "src/main.zig");
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
// https://github.com/ziglang/zig/issues/855
|
||||
exe.addPackagePath("smithy", "smithy/src/smithy.zig");
|
||||
// TODO: Embed the current git version in the code. We can do this
|
||||
// by looking for .git/HEAD (if it exists, follow the ref to /ref/heads/whatevs,
|
||||
// grab that commit, and use b.addOptions/exe.addOptions to generate the
|
||||
// Options file. See https://github.com/ziglang/zig/issues/14979 for usage
|
||||
// example.
|
||||
//
|
||||
// From there, I'm not sure what the generated file looks like or quite how
|
||||
// to use, but that should be easy. It may also give some ideas on the
|
||||
// code gen piece itself, though it might be nice to leave as a seperate
|
||||
// executable
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "demo",
|
||||
.root_source_file = .{ .path = "src/main.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
const smithy_dep = b.dependency("smithy", .{
|
||||
// These are the arguments to the dependency. It expects a target and optimization level.
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
exe.addModule("smithy", smithy_dep.module("smithy"));
|
||||
|
||||
exe.setTarget(target);
|
||||
exe.setBuildMode(mode);
|
||||
const module = b.addModule("aws", .{
|
||||
.source_file = .{ .path = "src/aws.zig" },
|
||||
});
|
||||
exe.addModule("aws", module);
|
||||
// TODO: This does not work correctly due to https://github.com/ziglang/zig/issues/16354
|
||||
//
|
||||
// We are working here with kind of a weird dependency though. So we can do this
|
||||
// another way
|
||||
//
|
||||
// TODO: These target/optimize are not correct, as we need to run the thing
|
||||
// const codegen = b.anonymousDependency("codegen/", @import("codegen/build.zig"), .{
|
||||
// .target = target,
|
||||
// .optimize = optimize,
|
||||
// });
|
||||
// const codegen_cmd = b.addRunArtifact(codegen.artifact("codegen"));
|
||||
// exe.step.dependOn(&codegen_cmd.step);
|
||||
|
||||
if (target.getOs().tag != .macos) exe.linkage = .static;
|
||||
|
||||
// TODO: Strip doesn't actually fully strip the executable. If we're on
|
||||
// linux we can run strip on the result, probably at the expense
|
||||
// of busting cache logic
|
||||
exe.strip = b.option(bool, "strip", "strip exe [true]") orelse true;
|
||||
const copy_deps = CopyStep.create(
|
||||
b,
|
||||
"zfetch_deps.zig",
|
||||
"libs/zfetch/deps.zig",
|
||||
);
|
||||
copy_deps.step.dependOn(&zfetch_repo.step);
|
||||
|
||||
const version = VersionStep.create(b, null);
|
||||
exe.step.dependOn(&version.step);
|
||||
exe.step.dependOn(©_deps.step);
|
||||
|
||||
// This import won't work unless we're already cloned. The way around
|
||||
// this is to have a multi-stage build process, but that's a lot of work.
|
||||
// Instead, I've copied the addPackage and tweaked it for the build prefix
|
||||
// so we'll have to keep that in sync with upstream
|
||||
// const zfetch = @import("libs/zfetch/build.zig");
|
||||
exe.addPackage(getZfetchPackage(b, "libs/zfetch") catch unreachable);
|
||||
exe.addPackagePath("iguanaTLS", "libs/zfetch/libs/iguanaTLS/src/main.zig");
|
||||
|
||||
const run_cmd = exe.run();
|
||||
const run_cmd = b.addRunArtifact(exe);
|
||||
run_cmd.step.dependOn(b.getInstallStep());
|
||||
if (b.args) |args| {
|
||||
run_cmd.addArgs(args);
|
||||
|
@ -64,73 +68,123 @@ pub fn build(b: *Builder) !void {
|
|||
const run_step = b.step("run", "Run the app");
|
||||
run_step.dependOn(&run_cmd.step);
|
||||
|
||||
var test_step = try tst.addTestStep(b, mode, exe.packages.items);
|
||||
test_step.dependOn(&version.step);
|
||||
// Creates a step for unit testing. This only builds the test executable
|
||||
// but does not run it.
|
||||
const unit_tests = b.addTest(.{
|
||||
.root_source_file = .{ .path = "src/aws.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
unit_tests.addModule("smithy", smithy_dep.module("smithy"));
|
||||
|
||||
var codegen: ?*std.build.Step = null;
|
||||
if (target.getOs().tag == .linux) {
|
||||
// TODO: Support > linux with RunStep
|
||||
// std.build.RunStep.create(null,null).cwd(std.fs.path.resolve(b.build_root, "codegen")).addArgs(...)
|
||||
codegen = b.step("gen", "Generate zig service code from smithy models");
|
||||
const cg = codegen.?;
|
||||
cg.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", "cd codegen && zig build" }).step);
|
||||
const run_unit_tests = b.addRunArtifact(unit_tests);
|
||||
|
||||
// This can probably be triggered instead by GitRepoStep cloning the repo
|
||||
// with models
|
||||
// Since codegen binary is built every time, if it's newer than our
|
||||
// service manifest we know it needs to be regenerated. So this step
|
||||
// will remove the service manifest if codegen has been touched, thereby
|
||||
// triggering the re-gen
|
||||
cg.dependOn(&b.addSystemCommand(&.{
|
||||
"/bin/sh", "-c",
|
||||
\\ [ ! -f src/models/service_manifest.zig ] || \
|
||||
\\ [ $(find codegen -type f -newer src/models/service_manifest.zig -print -quit |wc -c) = '0' ] || \
|
||||
\\ rm src/models/service_manifest.zig
|
||||
}).step);
|
||||
cg.dependOn(&b.addSystemCommand(&.{
|
||||
"/bin/sh", "-c",
|
||||
\\ mkdir -p src/models/ && \
|
||||
\\ [ -f src/models/service_manifest.zig ] || \
|
||||
\\ ( cd codegen/models && ../codegen *.json && mv *.zig ../../src/models )
|
||||
}).step);
|
||||
exe.step.dependOn(cg);
|
||||
}
|
||||
// Similar to creating the run step earlier, this exposes a `test` step to
|
||||
// the `zig build --help` menu, providing a way for the user to request
|
||||
// running the unit tests.
|
||||
const test_step = b.step("test", "Run unit tests");
|
||||
test_step.dependOn(&run_unit_tests.step);
|
||||
|
||||
exe.install();
|
||||
}
|
||||
const fm = b.step("fetch", "Fetch model files");
|
||||
var fetch_step = FetchStep.create(b, models_url, models_hash);
|
||||
fm.dependOn(&fetch_step.step);
|
||||
{
|
||||
const cg = b.step("gen", "Generate zig service code from smithy models");
|
||||
|
||||
fn getDependency(comptime lib_prefix: []const u8, comptime name: []const u8, comptime root: []const u8) !std.build.Pkg {
|
||||
const path = lib_prefix ++ "/libs/" ++ name ++ "/" ++ root;
|
||||
|
||||
// We don't actually care if the dependency has been checked out, as
|
||||
// GitRepoStep will handle that for us
|
||||
// Make sure that the dependency has been checked out.
|
||||
// std.fs.cwd().access(path, .{}) catch |err| switch (err) {
|
||||
// error.FileNotFound => {
|
||||
// std.log.err("zfetch: dependency '{s}' not checked out", .{name});
|
||||
const cg_exe = b.addExecutable(.{
|
||||
.name = "codegen",
|
||||
.root_source_file = .{ .path = "codegen/src/main.zig" },
|
||||
// We need this generated for the host, not the real target
|
||||
// .target = target,
|
||||
.optimize = if (b.verbose) .Debug else .ReleaseSafe,
|
||||
});
|
||||
cg_exe.addModule("smithy", smithy_dep.module("smithy"));
|
||||
var cg_cmd = b.addRunArtifact(cg_exe);
|
||||
cg_cmd.addArg("--models");
|
||||
cg_cmd.addArg(try std.fs.path.join(
|
||||
b.allocator,
|
||||
&[_][]const u8{ b.global_cache_root.path.?, models_dir },
|
||||
));
|
||||
// cg_cmd.addDirectoryArg(std.Build.FileSource.relative("codegen/models"));
|
||||
cg_cmd.addArg("--output");
|
||||
cg_cmd.addDirectoryArg(std.Build.FileSource.relative("src/models"));
|
||||
if (b.verbose)
|
||||
cg_cmd.addArg("--verbose");
|
||||
cg_cmd.step.dependOn(&fetch_step.step);
|
||||
// TODO: this should use zig_exe from std.Build
|
||||
// codegen should store a hash in a comment
|
||||
// this would be hash of the exe that created the file
|
||||
// concatenated with hash of input json. this would
|
||||
// allow skipping generated files. May not include hash
|
||||
// of contents of output file as maybe we want to tweak
|
||||
// manually??
|
||||
//
|
||||
// return err;
|
||||
// },
|
||||
// else => return err,
|
||||
// };
|
||||
// All the hashes can be in service_manifest.zig, which
|
||||
// could be fun to just parse and go nuts. Top of
|
||||
// file, generator exe hash. Each import has comment
|
||||
// with both input and output hash and we can decide
|
||||
// later about warning on manual changes...
|
||||
//
|
||||
// this scheme would permit cross plat codegen and maybe
|
||||
// we can have codegen added in a seperate repo,
|
||||
// though not sure how necessary that is
|
||||
// cg.dependOn(&b.addSystemCommand(&.{
|
||||
// b.zig_exe,
|
||||
// "build",
|
||||
// "run",
|
||||
// "-Doptimize=ReleaseSafe",
|
||||
// }).step);
|
||||
|
||||
return std.build.Pkg{
|
||||
.name = name,
|
||||
.path = .{ .path = path },
|
||||
};
|
||||
cg.dependOn(&cg_cmd.step);
|
||||
exe.step.dependOn(cg);
|
||||
unit_tests.step.dependOn(cg);
|
||||
}
|
||||
|
||||
pub fn getZfetchPackage(b: *std.build.Builder, comptime lib_prefix: []const u8) !std.build.Pkg {
|
||||
var dependencies = b.allocator.alloc(std.build.Pkg, 4) catch unreachable;
|
||||
|
||||
dependencies[0] = try getDependency(lib_prefix, "iguanaTLS", "src/main.zig");
|
||||
dependencies[1] = try getDependency(lib_prefix, "network", "network.zig");
|
||||
dependencies[2] = try getDependency(lib_prefix, "uri", "uri.zig");
|
||||
dependencies[3] = try getDependency(lib_prefix, "hzzp", "src/main.zig");
|
||||
|
||||
return std.build.Pkg{
|
||||
.name = "zfetch",
|
||||
.path = .{ .path = lib_prefix ++ "/src/main.zig" },
|
||||
.dependencies = dependencies,
|
||||
};
|
||||
b.installArtifact(exe);
|
||||
}
|
||||
const FetchStep = struct {
|
||||
step: std.Build.Step,
|
||||
url: []const u8,
|
||||
hash: ?[]const u8,
|
||||
|
||||
pub fn create(owner: *std.Build, url: []const u8, hash: ?[]const u8) *FetchStep {
|
||||
const fs = owner.allocator.create(FetchStep) catch @panic("OOM");
|
||||
fs.* = .{
|
||||
.step = std.Build.Step.init(.{
|
||||
.id = .custom,
|
||||
.name = "FetchStep",
|
||||
.owner = owner,
|
||||
.makeFn = make,
|
||||
}),
|
||||
.url = url,
|
||||
.hash = hash,
|
||||
};
|
||||
return fs;
|
||||
}
|
||||
|
||||
fn make(step: *std.Build.Step, prog_node: *std.Progress.Node) !void {
|
||||
const b = step.owner;
|
||||
const self = @fieldParentPtr(FetchStep, "step", step);
|
||||
|
||||
const alloc = b.allocator;
|
||||
var http_client: std.http.Client = .{ .allocator = alloc };
|
||||
defer http_client.deinit();
|
||||
|
||||
var thread_pool: std.Thread.Pool = undefined;
|
||||
try thread_pool.init(.{ .allocator = alloc });
|
||||
defer thread_pool.deinit();
|
||||
const pkg = try Package.fetchAndUnpack(
|
||||
&thread_pool,
|
||||
&http_client,
|
||||
b.global_cache_root,
|
||||
.{
|
||||
.url = self.url,
|
||||
.hash = self.hash,
|
||||
},
|
||||
self.url,
|
||||
prog_node,
|
||||
);
|
||||
defer alloc.destroy(pkg);
|
||||
defer pkg.deinit();
|
||||
}
|
||||
};
|
||||
|
|
11
build.zig.zon
Normal file
11
build.zig.zon
Normal file
|
@ -0,0 +1,11 @@
|
|||
.{
|
||||
.name = "aws-zig",
|
||||
.version = "0.0.1",
|
||||
|
||||
.dependencies = .{
|
||||
.smithy = .{
|
||||
.url = "https://git.lerch.org/lobo/smithy/archive/41b61745d25a65817209dd5dddbb5f9b66896a99.tar.gz",
|
||||
.hash = "122087deb0ae309b2258d59b40d82fe5921fdfc35b420bb59033244851f7f276fa34",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
//! Publish Date: 2022-01-12
|
||||
//! This file is hosted at ??? and is meant to be copied
|
||||
//! to projects that use it. Sample usage:
|
||||
//!
|
||||
//! const @"test" = @import("build_test.zig");
|
||||
//! var test_step = try @"test".addTestStep(b, mode, exe.packages.items);
|
||||
const std = @import("std");
|
||||
|
||||
pub fn addTestStep(b: *std.build.Builder, mode: std.builtin.Mode, packages: []std.build.Pkg) !*std.build.Step {
|
||||
const test_step = b.step("test", "Run all tests");
|
||||
var src_dir = try std.fs.openDirAbsolute(try std.fs.path.resolve(b.allocator, &[_][]const u8{
|
||||
b.build_root,
|
||||
"src",
|
||||
}), .{ .iterate = true });
|
||||
defer src_dir.close();
|
||||
var iterator = src_dir.iterate();
|
||||
while (try iterator.next()) |entry| {
|
||||
if (std.mem.endsWith(u8, entry.name, ".zig")) {
|
||||
const name = try std.fmt.allocPrint(b.allocator, "src/{s}", .{entry.name});
|
||||
defer b.allocator.free(name);
|
||||
const t = b.addTest(name);
|
||||
for (packages) |package| t.addPackage(package);
|
||||
t.setBuildMode(mode);
|
||||
test_step.dependOn(&t.step);
|
||||
}
|
||||
}
|
||||
return test_step;
|
||||
}
|
|
@ -7,19 +7,18 @@ as they do in other languages. We can combine all models from AWS into a single
|
|||
comptime constant even, however, we're keeping zig files 1:1 with json files
|
||||
for now.
|
||||
|
||||
The main executable, run with a "-s" first argument, will simply parse the
|
||||
Smithy json files passed by the rest of the arguments and save each one as
|
||||
its own file.json.zig. We will rely on shell commands to do the rest of the
|
||||
renaming (and moving if necessary).
|
||||
Optimization plan will be done by the placing of a json file in the output
|
||||
directory. The json file will contain a mapping between input files and generated
|
||||
outputs, as well as a top level directory hash. We can skip the output generation
|
||||
entirely if the top level hash matches, otherwise, individual hashes will be
|
||||
compared and output files will only regenerate if the input or output has changed.
|
||||
|
||||
To run this, we can use `codegen -s models/*.json`, which takes 20 seconds
|
||||
or so on my i5 chromebook and probably significantly faster on a real machine.
|
||||
No attempt has been made to optimize. Also, there are several bugs:
|
||||
|
||||
Todo
|
||||
----
|
||||
|
||||
* I do not think all the optional types have been sorted.
|
||||
* I think there is necessary metadata missing from EC2Query style services
|
||||
* The output will compile and is close to what `zig fmt` likes to see, but it
|
||||
has not yet been functionally tested
|
||||
* It handles all the types in existing AWS services, but it does not handle
|
||||
all known Smithy types (e.g. blob and document are missing)
|
||||
* It would be awesome to bring over the documentation from the model into
|
||||
|
@ -29,13 +28,7 @@ No attempt has been made to optimize. Also, there are several bugs:
|
|||
realistically I'm not sure if that will matter long term, and it's a fair
|
||||
amount of work as everything now can be done in a single pass without post
|
||||
processing.
|
||||
* This doesn't seem to build on 0.7.1 - you need master branch. I hope that
|
||||
0.8.0 will be out soon. If not, a few syntax changes need to be accommodated.
|
||||
|
||||
Some of these will likely be addressed as I integrate the code generated files into
|
||||
the SDK engine.
|
||||
|
||||
The models are Smithy json files, sourced from the AWS v2 go sdk
|
||||
for lack of a better place. I've just downloaded the main branch and copied
|
||||
the files from the tree in place.
|
||||
|
||||
for lack of a better place. Details are in build.zig of the parent project
|
||||
that is now responsible for downloading/caching the project.
|
|
@ -1,5 +1,8 @@
|
|||
const std = @import("std");
|
||||
|
||||
// Although this function looks imperative, note that its job is to
|
||||
// declaratively construct a build graph that will be executed by an external
|
||||
// runner.
|
||||
pub fn build(b: *std.build.Builder) !void {
|
||||
// Standard target options allows the person running `zig build` to choose
|
||||
// what target to build for. Here we do not override the defaults, which
|
||||
|
@ -7,53 +10,65 @@ pub fn build(b: *std.build.Builder) !void {
|
|||
// for restricting supported target set are available.
|
||||
const target = b.standardTargetOptions(.{});
|
||||
|
||||
// Standard release options allow the person running `zig build` to select
|
||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
||||
const mode = b.standardReleaseOptions();
|
||||
// Standard optimization options allow the person running `zig build` to select
|
||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
|
||||
// set a preferred release mode, allowing the user to decide how to optimize.
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
const exe = b.addExecutable("codegen", "src/main.zig");
|
||||
exe.addPackagePath("smithy", "../smithy/src/smithy.zig");
|
||||
exe.setTarget(target);
|
||||
exe.setBuildMode(mode);
|
||||
// This line works as of c5d412268
|
||||
// Earliest nightly is 05b5e49bc on 2021-06-12
|
||||
// https://ziglang.org/builds/zig-linux-x86_64-0.9.0-dev.113+05b5e49bc.tar.xz
|
||||
// exe.override_dest_dir = .{ .Custom = ".." };
|
||||
exe.override_dest_dir = .{ .custom = ".." };
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "codegen",
|
||||
.root_source_file = .{ .path = "src/main.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
// Static linkage flag was nonfunctional until 2b2efa24d0855
|
||||
// Did not notice this until 2021-06-28, and that nightly is:
|
||||
// https://ziglang.org/builds/zig-linux-x86_64-0.9.0-dev.321+15a030ef3.tar.xz
|
||||
exe.linkage = .static;
|
||||
const smithy_dep = b.dependency("smithy", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
exe.addModule("smithy", smithy_dep.module("smithy"));
|
||||
|
||||
const is_strip = b.option(bool, "strip", "strip exe") orelse true;
|
||||
exe.strip = !is_strip;
|
||||
exe.install();
|
||||
// This declares intent for the executable to be installed into the
|
||||
// standard location when the user invokes the "install" step (the default
|
||||
// step when running `zig build`).
|
||||
b.installArtifact(exe);
|
||||
|
||||
const run_cmd = exe.run();
|
||||
// This *creates* a Run step in the build graph, to be executed when another
|
||||
// step is evaluated that depends on it. The next line below will establish
|
||||
// such a dependency.
|
||||
const run_cmd = b.addRunArtifact(exe);
|
||||
|
||||
// By making the run step depend on the install step, it will be run from the
|
||||
// installation directory rather than directly from within the cache directory.
|
||||
// This is not necessary, however, if the application depends on other installed
|
||||
// files, this ensures they will be present and in the expected location.
|
||||
run_cmd.step.dependOn(b.getInstallStep());
|
||||
|
||||
// This allows the user to pass arguments to the application in the build
|
||||
// command itself, like this: `zig build run -- arg1 arg2 etc`
|
||||
if (b.args) |args| {
|
||||
run_cmd.addArgs(args);
|
||||
}
|
||||
|
||||
// This creates a build step. It will be visible in the `zig build --help` menu,
|
||||
// and can be selected like this: `zig build run`
|
||||
// This will evaluate the `run` step rather than the default, which is "install".
|
||||
const run_step = b.step("run", "Run the app");
|
||||
run_step.dependOn(&run_cmd.step);
|
||||
|
||||
const test_step = b.step("test", "Run library tests");
|
||||
var build_dir = try std.fs.openDirAbsolute(b.build_root, .{});
|
||||
defer build_dir.close();
|
||||
var src_dir = try build_dir.openDir("src", .{ .iterate = true });
|
||||
defer src_dir.close();
|
||||
var iterator = src_dir.iterate();
|
||||
while (try iterator.next()) |entry| {
|
||||
if (std.mem.endsWith(u8, entry.name, ".zig") and
|
||||
!std.mem.eql(u8, entry.name, "main.zig"))
|
||||
{
|
||||
const name = try std.fmt.allocPrint(b.allocator, "src/{s}", .{entry.name});
|
||||
defer b.allocator.free(name);
|
||||
const t = b.addTest(name);
|
||||
t.setBuildMode(mode);
|
||||
test_step.dependOn(&t.step);
|
||||
}
|
||||
}
|
||||
// Creates a step for unit testing. This only builds the test executable
|
||||
// but does not run it.
|
||||
const unit_tests = b.addTest(.{
|
||||
.root_source_file = .{ .path = "src/main.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
const run_unit_tests = b.addRunArtifact(unit_tests);
|
||||
|
||||
// Similar to creating the run step earlier, this exposes a `test` step to
|
||||
// the `zig build --help` menu, providing a way for the user to request
|
||||
// running the unit tests.
|
||||
const test_step = b.step("test", "Run unit tests");
|
||||
test_step.dependOn(&run_unit_tests.step);
|
||||
}
|
||||
|
|
11
codegen/build.zig.zon
Normal file
11
codegen/build.zig.zon
Normal file
|
@ -0,0 +1,11 @@
|
|||
.{
|
||||
.name = "aws-zig-codegen",
|
||||
.version = "0.0.1",
|
||||
|
||||
.dependencies = .{
|
||||
.smithy = .{
|
||||
.url = "https://git.lerch.org/lobo/smithy/archive/41b61745d25a65817209dd5dddbb5f9b66896a99.tar.gz",
|
||||
.hash = "122087deb0ae309b2258d59b40d82fe5921fdfc35b420bb59033244851f7f276fa34",
|
||||
},
|
||||
},
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -1,938 +0,0 @@
|
|||
{
|
||||
"smithy": "1.0",
|
||||
"shapes": {
|
||||
"com.amazonaws.amp#AccessDeniedException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Description of the error.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "User does not have sufficient access to perform this action.",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 403
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#AmazonPrometheusService": {
|
||||
"type": "service",
|
||||
"version": "2020-08-01",
|
||||
"resources": [
|
||||
{
|
||||
"target": "com.amazonaws.amp#Workspace"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"aws.api#service": {
|
||||
"sdkId": "amp",
|
||||
"arnNamespace": "aps",
|
||||
"cloudFormationName": "AmazonPrometheusService",
|
||||
"cloudTrailEventSource": "CLOUDTRAIL_PLACEHOLDER_REPLACED_BY_CDK"
|
||||
},
|
||||
"aws.auth#sigv4": {
|
||||
"name": "aps"
|
||||
},
|
||||
"aws.protocols#restJson1": {},
|
||||
"smithy.api#cors": {
|
||||
"additionalAllowedHeaders": [
|
||||
"Authorization",
|
||||
"x-amz-content-sha256",
|
||||
"X-Amz-Date",
|
||||
"x-amzn-trace-id",
|
||||
"X-Amz-Security-Token",
|
||||
"x-amz-user-agent",
|
||||
"*",
|
||||
"content-type",
|
||||
"x-amzn-platform-id",
|
||||
"X-Amz-Target",
|
||||
"Date"
|
||||
],
|
||||
"additionalExposedHeaders": [
|
||||
"date",
|
||||
"x-amz-apigw-id",
|
||||
"x-amzn-trace-id",
|
||||
"x-amzn-errortype",
|
||||
"x-amzn-requestid",
|
||||
"x-amzn-errormessage"
|
||||
]
|
||||
},
|
||||
"smithy.api#documentation": "Amazon Managed Service for Prometheus",
|
||||
"smithy.api#title": "Amazon Prometheus Service"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ConflictException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Description of the error.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"resourceId": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Identifier of the resource affected.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"resourceType": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Type of the resource affected.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Updating or deleting a resource can cause an inconsistent state.",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 409
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#CreateWorkspace": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.amp#CreateWorkspaceRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.amp#CreateWorkspaceResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.amp#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ConflictException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ServiceQuotaExceededException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Creates a new AMP workspace.",
|
||||
"smithy.api#http": {
|
||||
"method": "POST",
|
||||
"uri": "/workspaces",
|
||||
"code": 202
|
||||
},
|
||||
"smithy.api#idempotent": {}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#CreateWorkspaceRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"alias": {
|
||||
"target": "com.amazonaws.amp#WorkspaceAlias",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "An optional user-assigned alias for this workspace. This alias is for user reference and does not need to be unique."
|
||||
}
|
||||
},
|
||||
"clientToken": {
|
||||
"target": "com.amazonaws.amp#IdempotencyToken",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.",
|
||||
"smithy.api#idempotencyToken": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the input of a CreateWorkspace operation."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#CreateWorkspaceResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"workspaceId": {
|
||||
"target": "com.amazonaws.amp#WorkspaceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The generated ID of the workspace that was just created.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"arn": {
|
||||
"target": "com.amazonaws.amp#WorkspaceArn",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The ARN of the workspace that was just created.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"target": "com.amazonaws.amp#WorkspaceStatus",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The status of the workspace that was just created (usually CREATING).",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the output of a CreateWorkspace operation."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#DeleteWorkspace": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.amp#DeleteWorkspaceRequest"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.amp#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ResourceNotFoundException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Deletes an AMP workspace.",
|
||||
"smithy.api#http": {
|
||||
"method": "DELETE",
|
||||
"uri": "/workspaces/{workspaceId}",
|
||||
"code": 202
|
||||
},
|
||||
"smithy.api#idempotent": {}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#DeleteWorkspaceRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"workspaceId": {
|
||||
"target": "com.amazonaws.amp#WorkspaceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The ID of the workspace to delete.",
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"clientToken": {
|
||||
"target": "com.amazonaws.amp#IdempotencyToken",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.",
|
||||
"smithy.api#httpQuery": "clientToken",
|
||||
"smithy.api#idempotencyToken": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the input of a DeleteWorkspace operation."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#DescribeWorkspace": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.amp#DescribeWorkspaceRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.amp#DescribeWorkspaceResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.amp#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ResourceNotFoundException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Describes an existing AMP workspace.",
|
||||
"smithy.api#http": {
|
||||
"method": "GET",
|
||||
"uri": "/workspaces/{workspaceId}",
|
||||
"code": 200
|
||||
},
|
||||
"smithy.api#readonly": {}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#DescribeWorkspaceRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"workspaceId": {
|
||||
"target": "com.amazonaws.amp#WorkspaceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The ID of the workspace to describe.",
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the input of a DescribeWorkspace operation."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#DescribeWorkspaceResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"workspace": {
|
||||
"target": "com.amazonaws.amp#WorkspaceDescription",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The properties of the selected workspace.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the output of a DescribeWorkspace operation."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#IdempotencyToken": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "An identifier used to ensure the idempotency of a write request.",
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 64
|
||||
},
|
||||
"smithy.api#pattern": "[!-~]+"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#InternalServerException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Description of the error.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"retryAfterSeconds": {
|
||||
"target": "smithy.api#Integer",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Advice to clients on when the call can be safely retried.",
|
||||
"smithy.api#httpHeader": "Retry-After"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Unexpected error during processing of request.",
|
||||
"smithy.api#error": "server",
|
||||
"smithy.api#httpError": 500,
|
||||
"smithy.api#retryable": {}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ListWorkspaces": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.amp#ListWorkspacesRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.amp#ListWorkspacesResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.amp#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Lists all AMP workspaces, including workspaces being created or deleted.",
|
||||
"smithy.api#http": {
|
||||
"method": "GET",
|
||||
"uri": "/workspaces",
|
||||
"code": 200
|
||||
},
|
||||
"smithy.api#paginated": {
|
||||
"inputToken": "nextToken",
|
||||
"outputToken": "nextToken",
|
||||
"items": "workspaces",
|
||||
"pageSize": "maxResults"
|
||||
},
|
||||
"smithy.api#readonly": {}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ListWorkspacesRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"nextToken": {
|
||||
"target": "com.amazonaws.amp#PaginationToken",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListWorkspaces request.",
|
||||
"smithy.api#httpQuery": "nextToken"
|
||||
}
|
||||
},
|
||||
"alias": {
|
||||
"target": "com.amazonaws.amp#WorkspaceAlias",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Optional filter for workspace alias. Only the workspaces with aliases that begin with this value will be returned.",
|
||||
"smithy.api#httpQuery": "alias"
|
||||
}
|
||||
},
|
||||
"maxResults": {
|
||||
"target": "smithy.api#Integer",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Maximum results to return in response (default=100, maximum=1000).",
|
||||
"smithy.api#httpQuery": "maxResults",
|
||||
"smithy.api#range": {
|
||||
"min": 1,
|
||||
"max": 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the input of a ListWorkspaces operation."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ListWorkspacesResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"workspaces": {
|
||||
"target": "com.amazonaws.amp#WorkspaceSummaryList",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The list of existing workspaces, including those undergoing creation or deletion.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"nextToken": {
|
||||
"target": "com.amazonaws.amp#PaginationToken",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Pagination token to use when requesting the next page in this list."
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the output of a ListWorkspaces operation."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#PaginationToken": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "A token used to access the next page in a paginated result set."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ResourceNotFoundException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Description of the error.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"resourceId": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Identifier of the resource affected.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"resourceType": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Type of the resource affected.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Request references a resource which does not exist.",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 404
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ServiceQuotaExceededException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Description of the error.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"resourceId": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Identifier of the resource affected.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"resourceType": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Type of the resource affected.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"serviceCode": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Service Quotas requirement to identify originating service.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"quotaCode": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Service Quotas requirement to identify originating quota.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Request would cause a service quota to be exceeded.",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 402
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ThrottlingException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Description of the error.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"serviceCode": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Service Quotas requirement to identify originating service."
|
||||
}
|
||||
},
|
||||
"quotaCode": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Service Quotas requirement to identify originating quota."
|
||||
}
|
||||
},
|
||||
"retryAfterSeconds": {
|
||||
"target": "smithy.api#Integer",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Advice to clients on when the call can be safely retried.",
|
||||
"smithy.api#httpHeader": "Retry-After"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Request was denied due to request throttling.",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 429,
|
||||
"smithy.api#retryable": {}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#UpdateWorkspaceAlias": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.amp#UpdateWorkspaceAliasRequest"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.amp#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ConflictException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ResourceNotFoundException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ServiceQuotaExceededException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.amp#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Updates an AMP workspace alias.",
|
||||
"smithy.api#http": {
|
||||
"method": "POST",
|
||||
"uri": "/workspaces/{workspaceId}/alias",
|
||||
"code": 204
|
||||
},
|
||||
"smithy.api#idempotent": {}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#UpdateWorkspaceAliasRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"workspaceId": {
|
||||
"target": "com.amazonaws.amp#WorkspaceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The ID of the workspace being updated.",
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"alias": {
|
||||
"target": "com.amazonaws.amp#WorkspaceAlias",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The new alias of the workspace."
|
||||
}
|
||||
},
|
||||
"clientToken": {
|
||||
"target": "com.amazonaws.amp#IdempotencyToken",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.",
|
||||
"smithy.api#idempotencyToken": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the input of an UpdateWorkspaceAlias operation."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#Uri": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 1024
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ValidationException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Description of the error.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"reason": {
|
||||
"target": "com.amazonaws.amp#ValidationExceptionReason",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Reason the request failed validation.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"fieldList": {
|
||||
"target": "com.amazonaws.amp#ValidationExceptionFieldList",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The field that caused the error, if applicable. If more than one field caused the error, pick one and elaborate in the message."
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The input fails to satisfy the constraints specified by an AWS service.",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 400
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ValidationExceptionField": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"name": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The field name.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"message": {
|
||||
"target": "smithy.api#String",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Message describing why the field failed validation.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Stores information about a field passed inside a request that resulted in an exception."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ValidationExceptionFieldList": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.amp#ValidationExceptionField"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "A list of fields."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#ValidationExceptionReason": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Possible reasons a request failed validation.",
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "UNKNOWN_OPERATION",
|
||||
"name": "UNKNOWN_OPERATION"
|
||||
},
|
||||
{
|
||||
"value": "CANNOT_PARSE",
|
||||
"name": "CANNOT_PARSE"
|
||||
},
|
||||
{
|
||||
"value": "FIELD_VALIDATION_FAILED",
|
||||
"name": "FIELD_VALIDATION_FAILED"
|
||||
},
|
||||
{
|
||||
"value": "OTHER",
|
||||
"name": "OTHER"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#Workspace": {
|
||||
"type": "resource",
|
||||
"identifiers": {
|
||||
"workspaceId": {
|
||||
"target": "com.amazonaws.amp#WorkspaceId"
|
||||
}
|
||||
},
|
||||
"create": {
|
||||
"target": "com.amazonaws.amp#CreateWorkspace"
|
||||
},
|
||||
"read": {
|
||||
"target": "com.amazonaws.amp#DescribeWorkspace"
|
||||
},
|
||||
"update": {
|
||||
"target": "com.amazonaws.amp#UpdateWorkspaceAlias"
|
||||
},
|
||||
"delete": {
|
||||
"target": "com.amazonaws.amp#DeleteWorkspace"
|
||||
},
|
||||
"list": {
|
||||
"target": "com.amazonaws.amp#ListWorkspaces"
|
||||
},
|
||||
"traits": {
|
||||
"aws.api#arn": {
|
||||
"template": "workspace/{workspaceId}",
|
||||
"absolute": false,
|
||||
"noAccount": false,
|
||||
"noRegion": false
|
||||
},
|
||||
"smithy.api#documentation": "An AMP workspace is a logical and isolated Prometheus server dedicated to Prometheus resources such as metrics, where you ingest, store, and query your Prometheus metrics."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#WorkspaceAlias": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "A user-assigned workspace alias.",
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#WorkspaceArn": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"aws.api#arnReference": {
|
||||
"type": "AWS::APS::Workspace",
|
||||
"service": "com.amazonaws.services.awsprometheus.serviceapi#ManagedPrometheusCP",
|
||||
"resource": "com.amazonaws.amp#Workspace"
|
||||
},
|
||||
"smithy.api#documentation": "An ARN identifying a Workspace."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#WorkspaceDescription": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"workspaceId": {
|
||||
"target": "com.amazonaws.amp#WorkspaceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Unique string identifying this workspace.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"alias": {
|
||||
"target": "com.amazonaws.amp#WorkspaceAlias",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Alias of this workspace."
|
||||
}
|
||||
},
|
||||
"arn": {
|
||||
"target": "com.amazonaws.amp#WorkspaceArn",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The Amazon Resource Name (ARN) of this workspace.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"target": "com.amazonaws.amp#WorkspaceStatus",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The status of this workspace.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"prometheusEndpoint": {
|
||||
"target": "com.amazonaws.amp#Uri",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Prometheus endpoint URI."
|
||||
}
|
||||
},
|
||||
"createdAt": {
|
||||
"target": "smithy.api#Timestamp",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The time when the workspace was created.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the properties of a workspace.",
|
||||
"smithy.api#references": [
|
||||
{
|
||||
"resource": "com.amazonaws.amp#Workspace"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#WorkspaceId": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "A workspace ID.",
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 64
|
||||
},
|
||||
"smithy.api#pattern": "[0-9A-Za-z][-.0-9A-Z_a-z]*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#WorkspaceStatus": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"statusCode": {
|
||||
"target": "com.amazonaws.amp#WorkspaceStatusCode",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Status code of this workspace.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents the status of a workspace."
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#WorkspaceStatusCode": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "State of a workspace.",
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "CREATING",
|
||||
"name": "CREATING",
|
||||
"documentation": "Workspace is being created. Deletion is disallowed until status is ACTIVE."
|
||||
},
|
||||
{
|
||||
"value": "ACTIVE",
|
||||
"name": "ACTIVE",
|
||||
"documentation": "Workspace has been created and is usable."
|
||||
},
|
||||
{
|
||||
"value": "UPDATING",
|
||||
"name": "UPDATING",
|
||||
"documentation": "Workspace is being updated. Updates are allowed only when status is ACTIVE."
|
||||
},
|
||||
{
|
||||
"value": "DELETING",
|
||||
"name": "DELETING",
|
||||
"documentation": "Workspace is being deleted. Deletions are allowed only when status is ACTIVE."
|
||||
},
|
||||
{
|
||||
"value": "CREATION_FAILED",
|
||||
"name": "CREATION_FAILED",
|
||||
"documentation": "Workspace creation failed. Refer to WorkspaceStatus.failureReason for more details."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#WorkspaceSummary": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"workspaceId": {
|
||||
"target": "com.amazonaws.amp#WorkspaceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Unique string identifying this workspace.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"alias": {
|
||||
"target": "com.amazonaws.amp#WorkspaceAlias",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Alias of this workspace."
|
||||
}
|
||||
},
|
||||
"arn": {
|
||||
"target": "com.amazonaws.amp#WorkspaceArn",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The AmazonResourceName of this workspace.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"target": "com.amazonaws.amp#WorkspaceStatus",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The status of this workspace.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"createdAt": {
|
||||
"target": "smithy.api#Timestamp",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "The time when the workspace was created.",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Represents a summary of the properties of a workspace.",
|
||||
"smithy.api#references": [
|
||||
{
|
||||
"resource": "com.amazonaws.amp#Workspace"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.amp#WorkspaceSummaryList": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.amp#WorkspaceSummary"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "A list of workspace summaries."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,297 +0,0 @@
|
|||
{
|
||||
"smithy": "1.0",
|
||||
"metadata": {
|
||||
"suppressions": [
|
||||
{
|
||||
"id": "HttpMethodSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpResponseCodeSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "PaginatedTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpHeaderTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpUriConflict",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "Service",
|
||||
"namespace": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shapes": {
|
||||
"com.amazonaws.apigatewaymanagementapi#ApiGatewayManagementApi": {
|
||||
"type": "service",
|
||||
"version": "2018-11-29",
|
||||
"operations": [
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#DeleteConnection"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#GetConnection"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#PostToConnection"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"aws.api#service": {
|
||||
"sdkId": "ApiGatewayManagementApi",
|
||||
"arnNamespace": "apigateway",
|
||||
"cloudFormationName": "ApiGatewayManagementApi",
|
||||
"cloudTrailEventSource": "apigatewaymanagementapi.amazonaws.com",
|
||||
"endpointPrefix": "execute-api"
|
||||
},
|
||||
"aws.auth#sigv4": {
|
||||
"name": "execute-api"
|
||||
},
|
||||
"aws.protocols#restJson1": {},
|
||||
"smithy.api#documentation": "<p>The Amazon API Gateway Management API allows you to directly manage runtime aspects of your deployed APIs. To use it, you must explicitly set the SDK's endpoint to point to the endpoint of your deployed API. The endpoint will be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage}, or will be the endpoint corresponding to your API's custom domain and base path, if applicable.</p>",
|
||||
"smithy.api#title": "AmazonApiGatewayManagementApi"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#Data": {
|
||||
"type": "blob",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The data to be sent to the client specified by its connection id.</p>",
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 131072
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#DeleteConnection": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#DeleteConnectionRequest"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#ForbiddenException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#GoneException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#LimitExceededException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Delete the connection with the provided id.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "DELETE",
|
||||
"uri": "/@connections/{ConnectionId}",
|
||||
"code": 204
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#DeleteConnectionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ConnectionId": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#__string",
|
||||
"traits": {
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#ForbiddenException": {
|
||||
"type": "structure",
|
||||
"members": {},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The caller is not authorized to invoke this operation.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 403
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#GetConnection": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#GetConnectionRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#GetConnectionResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#ForbiddenException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#GoneException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#LimitExceededException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Get information about the connection with the provided id.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "GET",
|
||||
"uri": "/@connections/{ConnectionId}",
|
||||
"code": 200
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#GetConnectionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ConnectionId": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#__string",
|
||||
"traits": {
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#GetConnectionResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ConnectedAt": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#__timestampIso8601",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The time in ISO 8601 format for when the connection was established.</p>",
|
||||
"smithy.api#jsonName": "connectedAt"
|
||||
}
|
||||
},
|
||||
"Identity": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#Identity",
|
||||
"traits": {
|
||||
"smithy.api#jsonName": "identity"
|
||||
}
|
||||
},
|
||||
"LastActiveAt": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#__timestampIso8601",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The time in ISO 8601 format for when the connection was last active.</p>",
|
||||
"smithy.api#jsonName": "lastActiveAt"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#GoneException": {
|
||||
"type": "structure",
|
||||
"members": {},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The connection with the provided id no longer exists.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 410
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#Identity": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"SourceIp": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#__string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The source IP address of the TCP connection making the request to API Gateway.</p>",
|
||||
"smithy.api#jsonName": "sourceIp",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"UserAgent": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#__string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The User Agent of the API caller.</p>",
|
||||
"smithy.api#jsonName": "userAgent",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#LimitExceededException": {
|
||||
"type": "structure",
|
||||
"members": {},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The client is sending more than the allowed number of requests per unit of time or the WebSocket client side buffer is full.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 429
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#__string",
|
||||
"traits": {
|
||||
"smithy.api#jsonName": "message"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The data has exceeded the maximum size allowed.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 413
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#PostToConnection": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#PostToConnectionRequest"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#ForbiddenException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#GoneException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#LimitExceededException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Sends the provided data to the specified connection.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "POST",
|
||||
"uri": "/@connections/{ConnectionId}",
|
||||
"code": 200
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#PostToConnectionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Data": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#Data",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The data to be sent to the client specified by its connection id.</p>",
|
||||
"smithy.api#httpPayload": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"ConnectionId": {
|
||||
"target": "com.amazonaws.apigatewaymanagementapi#__string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The identifier of the connection that a specific client is using.</p>",
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#__string": {
|
||||
"type": "string"
|
||||
},
|
||||
"com.amazonaws.apigatewaymanagementapi#__timestampIso8601": {
|
||||
"type": "timestamp",
|
||||
"traits": {
|
||||
"smithy.api#timestampFormat": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,834 +0,0 @@
|
|||
{
|
||||
"smithy": "1.0",
|
||||
"metadata": {
|
||||
"suppressions": [
|
||||
{
|
||||
"id": "HttpMethodSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpResponseCodeSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "PaginatedTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpHeaderTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpUriConflict",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "Service",
|
||||
"namespace": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shapes": {
|
||||
"com.amazonaws.applicationcostprofiler#AWSApplicationCostProfiler": {
|
||||
"type": "service",
|
||||
"version": "2020-09-10",
|
||||
"operations": [
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#DeleteReportDefinition"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#GetReportDefinition"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ImportApplicationUsage"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ListReportDefinitions"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#PutReportDefinition"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#UpdateReportDefinition"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"aws.api#service": {
|
||||
"sdkId": "ApplicationCostProfiler",
|
||||
"arnNamespace": "application-cost-profiler",
|
||||
"cloudFormationName": "ApplicationCostProfiler",
|
||||
"cloudTrailEventSource": "applicationcostprofiler.amazonaws.com",
|
||||
"endpointPrefix": "application-cost-profiler"
|
||||
},
|
||||
"aws.auth#sigv4": {
|
||||
"name": "application-cost-profiler"
|
||||
},
|
||||
"aws.protocols#restJson1": {},
|
||||
"smithy.api#documentation": "<p>This reference provides descriptions of the AWS Application Cost Profiler API.</p>\n <p>The AWS Application Cost Profiler API provides programmatic access to view, create, update, and delete\n application cost report definitions, as well as to import your usage data into the Application Cost Profiler\n service.</p>\n <p>For more information about using this service, see the <a href=\"https://docs.aws.amazon.com/application-cost-profiler/latest/userguide/introduction.html\">AWS Application Cost\n Profiler User Guide</a>.</p>",
|
||||
"smithy.api#title": "AWS Application Cost Profiler"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#AccessDeniedException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>You do not have permission to perform this action.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 403
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#DeleteReportDefinition": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#DeleteReportDefinitionRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#DeleteReportDefinitionResult"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Deletes the specified report definition in AWS Application Cost Profiler. This stops the report from being\n generated.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "DELETE",
|
||||
"uri": "/reportDefinition/{reportId}",
|
||||
"code": 200
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#DeleteReportDefinitionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. ID of the report to delete.</p>",
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#DeleteReportDefinitionResult": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>ID of the report that was deleted.</p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ErrorMessage": {
|
||||
"type": "string"
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#Format": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "CSV",
|
||||
"name": "CSV"
|
||||
},
|
||||
{
|
||||
"value": "PARQUET",
|
||||
"name": "PARQUET"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#GetReportDefinition": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#GetReportDefinitionRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#GetReportDefinitionResult"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Retrieves the definition of a report already configured in AWS Application Cost Profiler.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "GET",
|
||||
"uri": "/reportDefinition/{reportId}",
|
||||
"code": 200
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#GetReportDefinitionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>ID of the report to retrieve.</p>",
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#GetReportDefinitionResult": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>ID of the report retrieved.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"reportDescription": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportDescription",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Description of the report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"reportFrequency": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportFrequency",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Cadence used to generate the report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"format": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Format",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Format of the generated report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"destinationS3Location": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3Location",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Amazon Simple Storage Service (Amazon S3) location where the report is uploaded.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"createdAt": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Timestamp",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Timestamp (milliseconds) when this report definition was created.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"lastUpdated": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Timestamp",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Timestamp (milliseconds) when this report definition was last updated.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ImportApplicationUsage": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ImportApplicationUsageRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ImportApplicationUsageResult"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Ingests application usage data from Amazon Simple Storage Service (Amazon S3).</p>\n <p>The data must already exist in the S3 location. As part of the action, AWS Application Cost Profiler\n copies the object from your S3 bucket to an S3 bucket owned by Amazon for processing\n asynchronously.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "POST",
|
||||
"uri": "/importApplicationUsage",
|
||||
"code": 200
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ImportApplicationUsageRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"sourceS3Location": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#SourceS3Location",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Amazon S3 location to import application usage data from.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ImportApplicationUsageResult": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"importId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ImportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>ID of the import request.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ImportId": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 255
|
||||
},
|
||||
"smithy.api#pattern": "[0-9A-Za-z\\.\\-_]*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#Integer": {
|
||||
"type": "integer",
|
||||
"traits": {
|
||||
"smithy.api#box": {},
|
||||
"smithy.api#range": {
|
||||
"min": 1,
|
||||
"max": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#InternalServerException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>An internal server error occurred. Retry your request.</p>",
|
||||
"smithy.api#error": "server",
|
||||
"smithy.api#httpError": 500
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ListReportDefinitions": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ListReportDefinitionsRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ListReportDefinitionsResult"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Retrieves a list of all reports and their configurations for your AWS account.</p>\n <p>The maximum number of reports is one.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "GET",
|
||||
"uri": "/reportDefinition",
|
||||
"code": 200
|
||||
},
|
||||
"smithy.api#paginated": {
|
||||
"inputToken": "nextToken",
|
||||
"outputToken": "nextToken",
|
||||
"pageSize": "maxResults"
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ListReportDefinitionsRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"nextToken": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Token",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The token value from a previous call to access the next page of results.</p>",
|
||||
"smithy.api#httpQuery": "nextToken"
|
||||
}
|
||||
},
|
||||
"maxResults": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Integer",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The maximum number of results to return.</p>",
|
||||
"smithy.api#httpQuery": "maxResults"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ListReportDefinitionsResult": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportDefinitions": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportDefinitionList",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The retrieved reports.</p>"
|
||||
}
|
||||
},
|
||||
"nextToken": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Token",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The value of the next token, if it exists. Null if there are no more results.</p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#PutReportDefinition": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#PutReportDefinitionRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#PutReportDefinitionResult"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ServiceQuotaExceededException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Creates the report definition for a report in Application Cost Profiler.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "POST",
|
||||
"uri": "/reportDefinition",
|
||||
"code": 200
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#PutReportDefinitionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. ID of the report. You can choose any valid string matching the pattern for the\n ID.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"reportDescription": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportDescription",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. Description of the report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"reportFrequency": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportFrequency",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. The cadence to generate the report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"format": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Format",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. The format to use for the generated report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"destinationS3Location": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3Location",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads the\n report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#PutReportDefinitionResult": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>ID of the report.</p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ReportDefinition": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The ID of the report.</p>"
|
||||
}
|
||||
},
|
||||
"reportDescription": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportDescription",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Description of the report</p>"
|
||||
}
|
||||
},
|
||||
"reportFrequency": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportFrequency",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The cadence at which the report is generated.</p>"
|
||||
}
|
||||
},
|
||||
"format": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Format",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The format used for the generated reports.</p>"
|
||||
}
|
||||
},
|
||||
"destinationS3Location": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3Location",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The location in Amazon Simple Storage Service (Amazon S3) the reports should be saved to.</p>"
|
||||
}
|
||||
},
|
||||
"createdAt": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Timestamp",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Timestamp (milliseconds) when this report definition was created.</p>"
|
||||
}
|
||||
},
|
||||
"lastUpdatedAt": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Timestamp",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Timestamp (milliseconds) when this report definition was last updated.</p>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The configuration of a report in AWS Application Cost Profiler.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ReportDefinitionList": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportDefinition"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ReportDescription": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 1024
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ReportFrequency": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "MONTHLY",
|
||||
"name": "MONTHLY"
|
||||
},
|
||||
{
|
||||
"value": "DAILY",
|
||||
"name": "DAILY"
|
||||
},
|
||||
{
|
||||
"value": "ALL",
|
||||
"name": "ALL"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ReportId": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 255
|
||||
},
|
||||
"smithy.api#pattern": "^[0-9A-Za-z\\.\\-_]+$"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#S3Bucket": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 3,
|
||||
"max": 63
|
||||
},
|
||||
"smithy.api#pattern": "(?=^.{3,63}$)(?!^(\\d+\\.)+\\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])$)"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#S3BucketRegion": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "ap-east-1",
|
||||
"name": "AP_EAST_1"
|
||||
},
|
||||
{
|
||||
"value": "me-south-1",
|
||||
"name": "ME_SOUTH_1"
|
||||
},
|
||||
{
|
||||
"value": "eu-south-1",
|
||||
"name": "EU_SOUTH_1"
|
||||
},
|
||||
{
|
||||
"value": "af-south-1",
|
||||
"name": "AF_SOUTH_1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#S3Key": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 512
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#S3Location": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"bucket": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3Bucket",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Name of the S3 bucket.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"prefix": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3Prefix",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Prefix for the location to write to.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Represents the Amazon Simple Storage Service (Amazon S3) location where AWS Application Cost Profiler\n reports are generated and then written to.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#S3Prefix": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 512
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ServiceQuotaExceededException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Your request exceeds one or more of the service quotas.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 402
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#SourceS3Location": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"bucket": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3Bucket",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Name of the bucket.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"key": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3Key",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Key of the object.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"region": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3BucketRegion",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Region of the bucket. Only required for Regions that are disabled by default.\n For more infomration about Regions that are disabled by default, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable\">\n Enabling a Region</a> in the <i>AWS General Reference guide</i>.</p>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Represents the Amazon Simple Storage Service (Amazon S3) location where usage data is read\n from.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ThrottlingException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The calls to AWS Application Cost Profiler API are throttled. The request was denied.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 429
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#Timestamp": {
|
||||
"type": "timestamp"
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#Token": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 102400
|
||||
},
|
||||
"smithy.api#pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#UpdateReportDefinition": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#UpdateReportDefinitionRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#UpdateReportDefinitionResult"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#InternalServerException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ThrottlingException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.applicationcostprofiler#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Updates existing report in AWS Application Cost Profiler.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "PUT",
|
||||
"uri": "/reportDefinition/{reportId}",
|
||||
"code": 200
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#UpdateReportDefinitionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. ID of the report to update.</p>",
|
||||
"smithy.api#httpLabel": {},
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"reportDescription": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportDescription",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. Description of the report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"reportFrequency": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportFrequency",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. The cadence to generate the report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"format": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#Format",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. The format to use for the generated report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"destinationS3Location": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#S3Location",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads the\n report.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#UpdateReportDefinitionResult": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"reportId": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ReportId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>ID of the report.</p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.applicationcostprofiler#ValidationException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"message": {
|
||||
"target": "com.amazonaws.applicationcostprofiler#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The input fails to satisfy the constraints for the API.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 400
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,584 +0,0 @@
|
|||
{
|
||||
"smithy": "1.0",
|
||||
"metadata": {
|
||||
"suppressions": [
|
||||
{
|
||||
"id": "HttpMethodSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpResponseCodeSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "PaginatedTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpHeaderTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpUriConflict",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "Service",
|
||||
"namespace": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shapes": {
|
||||
"com.amazonaws.connectcontactlens#AccessDeniedException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.connectcontactlens#Message",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>You do not have sufficient access to perform this action.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 403
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#AmazonConnectContactLens": {
|
||||
"type": "service",
|
||||
"version": "2020-08-21",
|
||||
"operations": [
|
||||
{
|
||||
"target": "com.amazonaws.connectcontactlens#ListRealtimeContactAnalysisSegments"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"aws.api#service": {
|
||||
"sdkId": "Connect Contact Lens",
|
||||
"arnNamespace": "connect",
|
||||
"cloudFormationName": "ConnectContactLens",
|
||||
"cloudTrailEventSource": "connectcontactlens.amazonaws.com",
|
||||
"endpointPrefix": "contact-lens"
|
||||
},
|
||||
"aws.auth#sigv4": {
|
||||
"name": "connect"
|
||||
},
|
||||
"aws.protocols#restJson1": {},
|
||||
"smithy.api#documentation": "<p>Contact Lens for Amazon Connect enables you to analyze conversations between customer and agents,\n by using speech transcription, natural language processing, and intelligent search\n capabilities. It performs sentiment analysis, detects issues, and enables you to automatically\n categorize contacts.</p>\n <p>Contact Lens for Amazon Connect provides both real-time and post-call analytics of customer-agent\n conversations. For more information, see <a href=\"https://docs.aws.amazon.com/connect/latest/adminguide/analyze-conversations.html\">Analyze conversations using\n Contact Lens</a> in the <i>Amazon Connect Administrator Guide</i>. </p>",
|
||||
"smithy.api#title": "Amazon Connect Contact Lens"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#Categories": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"MatchedCategories": {
|
||||
"target": "com.amazonaws.connectcontactlens#MatchedCategories",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The category rules that have been matched in the analyzed segment.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"MatchedDetails": {
|
||||
"target": "com.amazonaws.connectcontactlens#MatchedDetails",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The category rule that was matched and when it occurred in the transcript.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Provides the category rules that are used to automatically categorize contacts based on\n uttered keywords and phrases.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#CategoryDetails": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"PointsOfInterest": {
|
||||
"target": "com.amazonaws.connectcontactlens#PointsOfInterest",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The section of audio where the category rule was detected.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Provides information about the category rule that was matched.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#CategoryName": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#CharacterOffset": {
|
||||
"type": "integer",
|
||||
"traits": {
|
||||
"smithy.api#range": {
|
||||
"min": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#CharacterOffsets": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"BeginOffsetChar": {
|
||||
"target": "com.amazonaws.connectcontactlens#CharacterOffset",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The beginning of the issue.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"EndOffsetChar": {
|
||||
"target": "com.amazonaws.connectcontactlens#CharacterOffset",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The end of the issue.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>For characters that were detected as issues, where they occur in the transcript.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#ContactId": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#InstanceId": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#InternalServiceException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.connectcontactlens#Message"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Request processing failed due to an error or failure with the service.</p>",
|
||||
"smithy.api#error": "server",
|
||||
"smithy.api#httpError": 500
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#InvalidRequestException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.connectcontactlens#Message"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The request is not valid.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 400
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#IssueDetected": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"CharacterOffsets": {
|
||||
"target": "com.amazonaws.connectcontactlens#CharacterOffsets",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The offset for when the issue was detected in the segment.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Potential issues that are detected based on an artificial intelligence analysis of each\n turn in the conversation.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#IssuesDetected": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.connectcontactlens#IssueDetected"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#ListRealtimeContactAnalysisSegments": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.connectcontactlens#ListRealtimeContactAnalysisSegmentsRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.connectcontactlens#ListRealtimeContactAnalysisSegmentsResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.connectcontactlens#AccessDeniedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.connectcontactlens#InternalServiceException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.connectcontactlens#InvalidRequestException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.connectcontactlens#ResourceNotFoundException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.connectcontactlens#ThrottlingException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Provides a list of analysis segments for a real-time analysis session.</p>",
|
||||
"smithy.api#http": {
|
||||
"method": "POST",
|
||||
"uri": "/realtime-contact-analysis/analysis-segments",
|
||||
"code": 200
|
||||
},
|
||||
"smithy.api#paginated": {
|
||||
"inputToken": "NextToken",
|
||||
"outputToken": "NextToken",
|
||||
"pageSize": "MaxResults"
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#ListRealtimeContactAnalysisSegmentsRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"InstanceId": {
|
||||
"target": "com.amazonaws.connectcontactlens#InstanceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The identifier of the Amazon Connect instance.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"ContactId": {
|
||||
"target": "com.amazonaws.connectcontactlens#ContactId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The identifier of the contact.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"MaxResults": {
|
||||
"target": "com.amazonaws.connectcontactlens#MaxResults",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The maximimum number of results to return per page.</p>"
|
||||
}
|
||||
},
|
||||
"NextToken": {
|
||||
"target": "com.amazonaws.connectcontactlens#NextToken",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.</p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#ListRealtimeContactAnalysisSegmentsResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Segments": {
|
||||
"target": "com.amazonaws.connectcontactlens#RealtimeContactAnalysisSegments",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>An analyzed transcript or category.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"NextToken": {
|
||||
"target": "com.amazonaws.connectcontactlens#NextToken",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>If there are additional results, this is the token for the next set of results. If response includes <code>nextToken</code> there are two possible scenarios:</p>\n <ul>\n <li>\n <p>There are more segments so another call is required to get them.</p>\n </li>\n <li>\n <p>There are no more segments at this time, but more may be available later (real-time\n analysis is in progress) so the client should call the operation again to get new\n segments.</p>\n </li>\n </ul>\n <p>If response does not include <code>nextToken</code>, the analysis is completed (successfully or failed) and there are no more segments to retrieve.</p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#MatchedCategories": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.connectcontactlens#CategoryName"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 150
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#MatchedDetails": {
|
||||
"type": "map",
|
||||
"key": {
|
||||
"target": "com.amazonaws.connectcontactlens#CategoryName"
|
||||
},
|
||||
"value": {
|
||||
"target": "com.amazonaws.connectcontactlens#CategoryDetails"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 150
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#MaxResults": {
|
||||
"type": "integer",
|
||||
"traits": {
|
||||
"smithy.api#range": {
|
||||
"min": 1,
|
||||
"max": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#Message": {
|
||||
"type": "string"
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#NextToken": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 131070
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#OffsetMillis": {
|
||||
"type": "integer",
|
||||
"traits": {
|
||||
"smithy.api#range": {
|
||||
"min": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#ParticipantId": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#ParticipantRole": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#PointOfInterest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"BeginOffsetMillis": {
|
||||
"target": "com.amazonaws.connectcontactlens#OffsetMillis",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The beginning offset in milliseconds where the category rule was detected.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"EndOffsetMillis": {
|
||||
"target": "com.amazonaws.connectcontactlens#OffsetMillis",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The ending offset in milliseconds where the category rule was detected.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The section of the contact audio where that category rule was detected.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#PointsOfInterest": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.connectcontactlens#PointOfInterest"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#RealtimeContactAnalysisSegment": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Transcript": {
|
||||
"target": "com.amazonaws.connectcontactlens#Transcript",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The analyzed transcript.</p>"
|
||||
}
|
||||
},
|
||||
"Categories": {
|
||||
"target": "com.amazonaws.connectcontactlens#Categories",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The matched category rules.</p>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>An analyzed segment for a real-time analysis session.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#RealtimeContactAnalysisSegments": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.connectcontactlens#RealtimeContactAnalysisSegment"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#ResourceNotFoundException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.connectcontactlens#Message"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The specified resource was not found.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 404
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#SentimentValue": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "POSITIVE",
|
||||
"name": "POSITIVE"
|
||||
},
|
||||
{
|
||||
"value": "NEUTRAL",
|
||||
"name": "NEUTRAL"
|
||||
},
|
||||
{
|
||||
"value": "NEGATIVE",
|
||||
"name": "NEGATIVE"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#ThrottlingException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.connectcontactlens#Message",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The throttling limit has been exceeded.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 429
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#Transcript": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Id": {
|
||||
"target": "com.amazonaws.connectcontactlens#TranscriptId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The identifier of the transcript.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"ParticipantId": {
|
||||
"target": "com.amazonaws.connectcontactlens#ParticipantId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The identifier of the participant.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"ParticipantRole": {
|
||||
"target": "com.amazonaws.connectcontactlens#ParticipantRole",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The role of participant. For example, is it a customer, agent, or system.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"Content": {
|
||||
"target": "com.amazonaws.connectcontactlens#TranscriptContent",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The content of the transcript.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"BeginOffsetMillis": {
|
||||
"target": "com.amazonaws.connectcontactlens#OffsetMillis",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The beginning offset in the contact for this transcript.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"EndOffsetMillis": {
|
||||
"target": "com.amazonaws.connectcontactlens#OffsetMillis",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The end offset in the contact for this transcript.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"Sentiment": {
|
||||
"target": "com.amazonaws.connectcontactlens#SentimentValue",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The sentiment of the detected for this piece of transcript.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"IssuesDetected": {
|
||||
"target": "com.amazonaws.connectcontactlens#IssuesDetected",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>List of positions where issues were detected on the transcript.</p>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A list of messages in the session.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#TranscriptContent": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.connectcontactlens#TranscriptId": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": ".*\\S.*"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,695 +0,0 @@
|
|||
{
|
||||
"smithy": "1.0",
|
||||
"metadata": {
|
||||
"suppressions": [
|
||||
{
|
||||
"id": "HttpMethodSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpResponseCodeSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "PaginatedTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpHeaderTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpUriConflict",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "Service",
|
||||
"namespace": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shapes": {
|
||||
"com.amazonaws.costandusagereportservice#AWSOrigamiServiceGatewayService": {
|
||||
"type": "service",
|
||||
"version": "2017-01-06",
|
||||
"operations": [
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#DeleteReportDefinition"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#DescribeReportDefinitions"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#ModifyReportDefinition"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#PutReportDefinition"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"aws.api#service": {
|
||||
"sdkId": "Cost and Usage Report Service",
|
||||
"arnNamespace": "cur",
|
||||
"cloudFormationName": "CostandUsageReportService",
|
||||
"cloudTrailEventSource": "costandusagereportservice.amazonaws.com",
|
||||
"endpointPrefix": "cur"
|
||||
},
|
||||
"aws.auth#sigv4": {
|
||||
"name": "cur"
|
||||
},
|
||||
"aws.protocols#awsJson1_1": {},
|
||||
"smithy.api#documentation": "<p>The AWS Cost and Usage Report API enables you to programmatically create, query, and delete \n AWS Cost and Usage report definitions.</p>\n <p>AWS Cost and Usage reports track the monthly AWS costs and usage \n associated with your AWS account.\n \n The report contains line items for each unique combination of AWS product,\n usage type, and operation that your AWS account uses. \n \n You can configure the AWS Cost and Usage report to show only the data that you want, using the\n AWS Cost and Usage API.</p>\n\n <p>Service Endpoint</p>\n <p>The AWS Cost and Usage Report API provides the following endpoint:</p>\n <ul>\n <li>\n <p>cur.us-east-1.amazonaws.com</p>\n </li>\n </ul>",
|
||||
"smithy.api#title": "AWS Cost and Usage Report Service"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#AWSRegion": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The region of the S3 bucket that AWS delivers the report into.</p>",
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "af-south-1",
|
||||
"name": "CAPE_TOWN"
|
||||
},
|
||||
{
|
||||
"value": "ap-east-1",
|
||||
"name": "HONG_KONG"
|
||||
},
|
||||
{
|
||||
"value": "ap-south-1",
|
||||
"name": "MUMBAI"
|
||||
},
|
||||
{
|
||||
"value": "ap-southeast-1",
|
||||
"name": "SINGAPORE"
|
||||
},
|
||||
{
|
||||
"value": "ap-southeast-2",
|
||||
"name": "SYDNEY"
|
||||
},
|
||||
{
|
||||
"value": "ap-northeast-1",
|
||||
"name": "TOKYO"
|
||||
},
|
||||
{
|
||||
"value": "ap-northeast-2",
|
||||
"name": "SEOUL"
|
||||
},
|
||||
{
|
||||
"value": "ap-northeast-3",
|
||||
"name": "OSAKA"
|
||||
},
|
||||
{
|
||||
"value": "ca-central-1",
|
||||
"name": "CANADA_CENTRAL"
|
||||
},
|
||||
{
|
||||
"value": "eu-central-1",
|
||||
"name": "FRANKFURT"
|
||||
},
|
||||
{
|
||||
"value": "eu-west-1",
|
||||
"name": "IRELAND"
|
||||
},
|
||||
{
|
||||
"value": "eu-west-2",
|
||||
"name": "LONDON"
|
||||
},
|
||||
{
|
||||
"value": "eu-west-3",
|
||||
"name": "PARIS"
|
||||
},
|
||||
{
|
||||
"value": "eu-north-1",
|
||||
"name": "STOCKHOLM"
|
||||
},
|
||||
{
|
||||
"value": "eu-south-1",
|
||||
"name": "MILANO"
|
||||
},
|
||||
{
|
||||
"value": "me-south-1",
|
||||
"name": "BAHRAIN"
|
||||
},
|
||||
{
|
||||
"value": "sa-east-1",
|
||||
"name": "SAO_PAULO"
|
||||
},
|
||||
{
|
||||
"value": "us-east-1",
|
||||
"name": "US_STANDARD"
|
||||
},
|
||||
{
|
||||
"value": "us-east-2",
|
||||
"name": "OHIO"
|
||||
},
|
||||
{
|
||||
"value": "us-west-1",
|
||||
"name": "NORTHERN_CALIFORNIA"
|
||||
},
|
||||
{
|
||||
"value": "us-west-2",
|
||||
"name": "OREGON"
|
||||
},
|
||||
{
|
||||
"value": "cn-north-1",
|
||||
"name": "BEIJING"
|
||||
},
|
||||
{
|
||||
"value": "cn-northwest-1",
|
||||
"name": "NINGXIA"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#AdditionalArtifact": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The types of manifest that you want AWS to create for this report.</p>",
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "REDSHIFT",
|
||||
"name": "REDSHIFT"
|
||||
},
|
||||
{
|
||||
"value": "QUICKSIGHT",
|
||||
"name": "QUICKSIGHT"
|
||||
},
|
||||
{
|
||||
"value": "ATHENA",
|
||||
"name": "ATHENA"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#AdditionalArtifactList": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.costandusagereportservice#AdditionalArtifact"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A list of additional artifacts.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#BillingViewArn": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 128
|
||||
},
|
||||
"smithy.api#pattern": "(arn:aws(-cn)?:billing::[0-9]{12}:billingview/)?[a-zA-Z0-9_\\+=\\.\\-@].{1,30}"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#CompressionFormat": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The compression format that AWS uses for the report.</p>",
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "ZIP",
|
||||
"name": "ZIP"
|
||||
},
|
||||
{
|
||||
"value": "GZIP",
|
||||
"name": "GZIP"
|
||||
},
|
||||
{
|
||||
"value": "Parquet",
|
||||
"name": "Parquet"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#DeleteReportDefinition": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.costandusagereportservice#DeleteReportDefinitionRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.costandusagereportservice#DeleteReportDefinitionResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#InternalErrorException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Deletes the specified report.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#DeleteReportDefinitionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ReportName": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportName",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The name of the report that you want to delete. The name must be unique, is case sensitive, and can't include spaces.</p>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Deletes the specified report.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#DeleteReportDefinitionResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ResponseMessage": {
|
||||
"target": "com.amazonaws.costandusagereportservice#DeleteResponseMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>If the action is successful, the service sends back an HTTP 200 response.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#DeleteResponseMessage": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Whether the deletion was successful or not.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#DescribeReportDefinitions": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.costandusagereportservice#DescribeReportDefinitionsRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.costandusagereportservice#DescribeReportDefinitionsResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#InternalErrorException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Lists the AWS Cost and Usage reports available to this account.</p>",
|
||||
"smithy.api#paginated": {
|
||||
"inputToken": "NextToken",
|
||||
"outputToken": "NextToken",
|
||||
"pageSize": "MaxResults"
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#DescribeReportDefinitionsRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"MaxResults": {
|
||||
"target": "com.amazonaws.costandusagereportservice#MaxResults"
|
||||
},
|
||||
"NextToken": {
|
||||
"target": "com.amazonaws.costandusagereportservice#GenericString"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Requests a list of AWS Cost and Usage reports owned by the account.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#DescribeReportDefinitionsResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ReportDefinitions": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportDefinitionList",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A list of AWS Cost and Usage reports owned by the account.</p>"
|
||||
}
|
||||
},
|
||||
"NextToken": {
|
||||
"target": "com.amazonaws.costandusagereportservice#GenericString"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>If the action is successful, the service sends back an HTTP 200 response.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#DuplicateReportNameException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A report with the specified name already exists in the account. Specify a different report name.</p>",
|
||||
"smithy.api#error": "client"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ErrorMessage": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A message to show the detail of the exception.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#GenericString": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A generic string.</p>",
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": "[A-Za-z0-9_\\.\\-=]*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#InternalErrorException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>An error on the server occurred during the processing of your request. Try again later.</p>",
|
||||
"smithy.api#error": "server"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#MaxResults": {
|
||||
"type": "integer",
|
||||
"traits": {
|
||||
"smithy.api#box": {},
|
||||
"smithy.api#documentation": "<p>The maximum number of results that AWS returns for the operation.</p>",
|
||||
"smithy.api#range": {
|
||||
"min": 5,
|
||||
"max": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ModifyReportDefinition": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ModifyReportDefinitionRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ModifyReportDefinitionResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#InternalErrorException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Allows you to programatically update your report preferences.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ModifyReportDefinitionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ReportName": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportName",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"ReportDefinition": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportDefinition",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ModifyReportDefinitionResponse": {
|
||||
"type": "structure",
|
||||
"members": {}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#PutReportDefinition": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.costandusagereportservice#PutReportDefinitionRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.costandusagereportservice#PutReportDefinitionResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#DuplicateReportNameException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#InternalErrorException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportLimitReachedException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.costandusagereportservice#ValidationException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Creates a new report using the description that you provide.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#PutReportDefinitionRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ReportDefinition": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportDefinition",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Represents the output of the PutReportDefinition operation. The content consists of the detailed \n metadata and data file information. </p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Creates a Cost and Usage Report.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#PutReportDefinitionResponse": {
|
||||
"type": "structure",
|
||||
"members": {},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#RefreshClosedReports": {
|
||||
"type": "boolean",
|
||||
"traits": {
|
||||
"smithy.api#box": {}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ReportDefinition": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"ReportName": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportName",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"TimeUnit": {
|
||||
"target": "com.amazonaws.costandusagereportservice#TimeUnit",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"Format": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportFormat",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"Compression": {
|
||||
"target": "com.amazonaws.costandusagereportservice#CompressionFormat",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"AdditionalSchemaElements": {
|
||||
"target": "com.amazonaws.costandusagereportservice#SchemaElementList",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A list of strings that indicate additional content that Amazon Web Services includes in the report, such as individual resource IDs. </p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"S3Bucket": {
|
||||
"target": "com.amazonaws.costandusagereportservice#S3Bucket",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"S3Prefix": {
|
||||
"target": "com.amazonaws.costandusagereportservice#S3Prefix",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"S3Region": {
|
||||
"target": "com.amazonaws.costandusagereportservice#AWSRegion",
|
||||
"traits": {
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"AdditionalArtifacts": {
|
||||
"target": "com.amazonaws.costandusagereportservice#AdditionalArtifactList",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A list of manifests that you want Amazon Web Services to create for this report.</p>"
|
||||
}
|
||||
},
|
||||
"RefreshClosedReports": {
|
||||
"target": "com.amazonaws.costandusagereportservice#RefreshClosedReports",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Whether you want Amazon Web Services to update your reports after they have been finalized if Amazon Web Services detects charges related to \n previous months. These charges can include refunds, credits, or support fees.</p>"
|
||||
}
|
||||
},
|
||||
"ReportVersioning": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportVersioning",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Whether you want Amazon Web Services to overwrite the previous version of each report or \n to deliver the report in addition to the previous versions.</p>"
|
||||
}
|
||||
},
|
||||
"BillingViewArn": {
|
||||
"target": "com.amazonaws.costandusagereportservice#BillingViewArn",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>\n The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs.\n </p>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The definition of AWS Cost and Usage Report. You can specify the report name, \n time unit, report format, compression format, S3 bucket, additional artifacts, and schema \n elements in the definition.\n </p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ReportDefinitionList": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ReportDefinition"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A list of report definitions.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ReportFormat": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The format that AWS saves the report in.</p>",
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "textORcsv",
|
||||
"name": "CSV"
|
||||
},
|
||||
{
|
||||
"value": "Parquet",
|
||||
"name": "Parquet"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ReportLimitReachedException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>This account already has five reports defined. To define a new report, you must delete an existing report.</p>",
|
||||
"smithy.api#error": "client"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ReportName": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The name of the report that you want to create. The name must be unique,\n is case sensitive, and can't include spaces. </p>",
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": "[0-9A-Za-z!\\-_.*\\'()]+"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ReportVersioning": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "CREATE_NEW_REPORT",
|
||||
"name": "CREATE_NEW_REPORT"
|
||||
},
|
||||
{
|
||||
"value": "OVERWRITE_REPORT",
|
||||
"name": "OVERWRITE_REPORT"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#S3Bucket": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The S3 bucket where AWS delivers the report.</p>",
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": "[A-Za-z0-9_\\.\\-]+"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#S3Prefix": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The prefix that AWS adds to the report name when AWS delivers the report. Your prefix\n can't include spaces.</p>",
|
||||
"smithy.api#length": {
|
||||
"min": 0,
|
||||
"max": 256
|
||||
},
|
||||
"smithy.api#pattern": "[0-9A-Za-z!\\-_.*\\'()/]*"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#SchemaElement": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Whether or not AWS includes resource IDs in the report. </p>",
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "RESOURCES",
|
||||
"name": "RESOURCES"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#SchemaElementList": {
|
||||
"type": "list",
|
||||
"member": {
|
||||
"target": "com.amazonaws.costandusagereportservice#SchemaElement"
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>A list of strings that indicate the content that is included in the report, such as service or usage type.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#TimeUnit": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The length of time covered by the report. </p>",
|
||||
"smithy.api#enum": [
|
||||
{
|
||||
"value": "HOURLY",
|
||||
"name": "HOURLY"
|
||||
},
|
||||
{
|
||||
"value": "DAILY",
|
||||
"name": "DAILY"
|
||||
},
|
||||
{
|
||||
"value": "MONTHLY",
|
||||
"name": "MONTHLY"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"com.amazonaws.costandusagereportservice#ValidationException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.costandusagereportservice#ErrorMessage"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The input fails to satisfy the constraints specified by an AWS service.</p>",
|
||||
"smithy.api#error": "client"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,396 +0,0 @@
|
|||
{
|
||||
"smithy": "1.0",
|
||||
"metadata": {
|
||||
"suppressions": [
|
||||
{
|
||||
"id": "HttpMethodSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpResponseCodeSemantics",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "PaginatedTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpHeaderTrait",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "HttpUriConflict",
|
||||
"namespace": "*"
|
||||
},
|
||||
{
|
||||
"id": "Service",
|
||||
"namespace": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shapes": {
|
||||
"com.amazonaws.ec2instanceconnect#AWSEC2InstanceConnectService": {
|
||||
"type": "service",
|
||||
"version": "2018-04-02",
|
||||
"operations": [
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#SendSerialConsoleSSHPublicKey"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#SendSSHPublicKey"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"aws.api#service": {
|
||||
"sdkId": "EC2 Instance Connect",
|
||||
"arnNamespace": "ec2-instance-connect",
|
||||
"cloudFormationName": "EC2InstanceConnect",
|
||||
"cloudTrailEventSource": "ec2instanceconnect.amazonaws.com",
|
||||
"endpointPrefix": "ec2-instance-connect"
|
||||
},
|
||||
"aws.auth#sigv4": {
|
||||
"name": "ec2-instance-connect"
|
||||
},
|
||||
"aws.protocols#awsJson1_1": {},
|
||||
"smithy.api#documentation": "<p>Amazon EC2 Instance Connect enables system administrators to publish one-time use SSH\n public keys to EC2, providing users a simple and secure way to connect to their\n instances.</p>",
|
||||
"smithy.api#title": "AWS EC2 Instance Connect"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#AuthException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Either your AWS credentials are not valid or you do not have access to the EC2 instance.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 403
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#AvailabilityZone": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 6,
|
||||
"max": 32
|
||||
},
|
||||
"smithy.api#pattern": "^(\\w+-){2,3}\\d+\\w+$"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The specified instance was not found.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 404
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The instance type is not supported for connecting via the serial console. Only Nitro\n instance types are currently supported.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 400
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#InstanceId": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 10,
|
||||
"max": 32
|
||||
},
|
||||
"smithy.api#pattern": "^i-[a-f0-9]+$"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#InstanceOSUser": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 1,
|
||||
"max": 32
|
||||
},
|
||||
"smithy.api#pattern": "^[A-Za-z_][A-Za-z0-9\\@\\._-]{0,30}[A-Za-z0-9\\$_-]?$"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#InvalidArgsException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>One of the parameters is not valid.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 400
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#RequestId": {
|
||||
"type": "string"
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SSHPublicKey": {
|
||||
"type": "string",
|
||||
"traits": {
|
||||
"smithy.api#length": {
|
||||
"min": 256,
|
||||
"max": 4096
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SendSSHPublicKey": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#SendSSHPublicKeyRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#SendSSHPublicKeyResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#AuthException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#InvalidArgsException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#ServiceException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#ThrottlingException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Pushes an SSH public key to the specified EC2 instance for use by the specified user.\n The key remains for 60 seconds. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html\">Connect to\n your Linux instance using EC2 Instance Connect</a> in the <i>Amazon EC2\n User Guide</i>.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SendSSHPublicKeyRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"InstanceId": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#InstanceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The ID of the EC2 instance.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"InstanceOSUser": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#InstanceOSUser",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The OS user on the EC2 instance for whom the key can be used to authenticate.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"SSHPublicKey": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#SSHPublicKey",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The public key material. To use the public key, you must have the matching private key.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"AvailabilityZone": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#AvailabilityZone",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The Availability Zone in which the EC2 instance was launched.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SendSSHPublicKeyResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"RequestId": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#RequestId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The ID of the request. Please provide this ID when contacting AWS Support for assistance.</p>"
|
||||
}
|
||||
},
|
||||
"Success": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#Success",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Is true if the request succeeds and an error otherwise.</p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SendSerialConsoleSSHPublicKey": {
|
||||
"type": "operation",
|
||||
"input": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#SendSerialConsoleSSHPublicKeyRequest"
|
||||
},
|
||||
"output": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#SendSerialConsoleSSHPublicKeyResponse"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#AuthException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#InvalidArgsException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#SerialConsoleAccessDisabledException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#SerialConsoleSessionLimitExceededException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#SerialConsoleSessionUnavailableException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#ServiceException"
|
||||
},
|
||||
{
|
||||
"target": "com.amazonaws.ec2instanceconnect#ThrottlingException"
|
||||
}
|
||||
],
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Pushes an SSH public key to the specified EC2 instance. The key remains for 60\n seconds, which gives you 60 seconds to establish a serial console connection to the\n instance using SSH. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html\">EC2 Serial Console</a> in\n the <i>Amazon EC2 User Guide</i>.</p>"
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SendSerialConsoleSSHPublicKeyRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"InstanceId": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#InstanceId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The ID of the EC2 instance.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
},
|
||||
"SerialPort": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#SerialPort",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The serial port of the EC2 instance. Currently only port 0 is supported.</p>\n <p>Default: 0</p>"
|
||||
}
|
||||
},
|
||||
"SSHPublicKey": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#SSHPublicKey",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The public key material. To use the public key, you must have the matching private\n key. For information about the supported key formats and lengths, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws\">Requirements for key pairs</a> in the <i>Amazon EC2 User\n Guide</i>.</p>",
|
||||
"smithy.api#required": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SendSerialConsoleSSHPublicKeyResponse": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"RequestId": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#RequestId",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The ID of the request. Please provide this ID when contacting AWS Support for assistance.</p>"
|
||||
}
|
||||
},
|
||||
"Success": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#Success",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Is true if the request succeeds and an error otherwise.</p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SerialConsoleAccessDisabledException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Your account is not authorized to use the EC2 Serial Console. To authorize your\n account, run the EnableSerialConsoleAccess API. For more information, see\n <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html\">EnableSerialConsoleAccess</a> in the <i>Amazon EC2 API Reference</i>.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 403
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SerialConsoleSessionLimitExceededException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The instance currently has 1 active serial console session. Only 1 session is supported at a time.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 400
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SerialConsoleSessionUnavailableException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>Unable to start a serial console session. Please try again.</p>",
|
||||
"smithy.api#error": "server",
|
||||
"smithy.api#httpError": 500
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#SerialPort": {
|
||||
"type": "integer",
|
||||
"traits": {
|
||||
"smithy.api#range": {
|
||||
"min": 0,
|
||||
"max": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#ServiceException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The service encountered an error. Follow the instructions in the error message and try again.</p>",
|
||||
"smithy.api#error": "server",
|
||||
"smithy.api#httpError": 500
|
||||
}
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#String": {
|
||||
"type": "string"
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#Success": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"com.amazonaws.ec2instanceconnect#ThrottlingException": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Message": {
|
||||
"target": "com.amazonaws.ec2instanceconnect#String"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"smithy.api#documentation": "<p>The requests were made too frequently and have been throttled. Wait a while and try again. \n To increase the limit on your request frequency, contact AWS Support.</p>",
|
||||
"smithy.api#error": "client",
|
||||
"smithy.api#httpError": 429
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user