licenses
sequencelengths 1
3
| version
stringclasses 677
values | tree_hash
stringlengths 40
40
| path
stringclasses 1
value | type
stringclasses 2
values | size
stringlengths 2
8
| text
stringlengths 25
67.1M
| package_name
stringlengths 2
41
| repo
stringlengths 33
86
|
---|---|---|---|---|---|---|---|---|
[
"MIT"
] | 0.3.0 | 855371d8fdfaed46dbb32a7c57a42db4441b9247 | code | 1079 | # StaticGraphs are binary files with the following format:
# sizeof(T), sizeU, f_vec, 0, f_ind
# StaticDiGraphs have the following format:
# bits in T, bits in U, f_vec, 0, f_ind, 0, b_vec, 0, b_ind
abstract type StaticGraphFormat <: AbstractGraphFormat end
struct SGFormat <: StaticGraphFormat end
struct SDGFormat <: StaticGraphFormat end
function savesg(fn::AbstractString, g::StaticGraph)
f_ind = g.f_ind
f_vec = g.f_vec
@save fn f_vec f_ind
return 1
end
function savesg(fn::AbstractString, g::StaticDiGraph)
f_ind = g.f_ind
f_vec = g.f_vec
b_ind = g.b_ind
b_vec = g.b_vec
@save fn f_vec f_ind b_vec b_ind
return 1
end
function loadsg(fn::AbstractString, ::SGFormat)
@load fn f_vec f_ind
return StaticGraph(f_vec, f_ind)
end
function loadsg(fn::AbstractString, ::SDGFormat)
@load fn f_vec f_ind b_vec b_ind
return StaticDiGraph(f_vec, f_ind, b_vec, b_ind)
end
loadgraph(fn::AbstractString, gname::String, s::StaticGraphFormat) = loadsg(fn, s)
savegraph(fn::AbstractString, g::AbstractStaticGraph) = savesg(fn, g) | StaticGraphs | https://github.com/JuliaGraphs/StaticGraphs.jl.git |
|
[
"MIT"
] | 0.3.0 | 855371d8fdfaed46dbb32a7c57a42db4441b9247 | code | 3492 | """
StaticDiGraph{T, U} <: AbstractStaticGraph{T, U}
A type representing a static directed graph.
"""
struct StaticDiGraph{T<:Integer, U<:Integer} <: AbstractStaticGraph{T, U}
f_vec::Vector{T}
f_ind::Vector{U}
b_vec::Vector{T}
b_ind::Vector{U}
end
@inline function _bvrange(g::StaticDiGraph, s)
@inbounds r_start = g.b_ind[s]
@inbounds r_end = g.b_ind[s + 1] - 1
return r_start:r_end
end
@inline function badj(g::StaticDiGraph, s)
r = _bvrange(g, s)
return view(g.b_vec, r)
end
@inline badj(g) = [badj(g, v) for v in vertices(g)]
ne(g::StaticDiGraph{T, U}) where T where U = U(length(g.f_vec))
# sorted src, dst vectors for forward and backward edgelists.
function StaticDiGraph(nvtx::I, f_ss::AbstractVector{F}, f_ds::AbstractVector{D}, b_ss::AbstractVector{B}, b_ds::AbstractVector{S}) where {I<:Integer,S<:Integer,D<:Integer,B<:Integer,F<:Integer}
length(f_ss) == length(f_ds) == length(b_ss) == length(b_ds) || error("source and destination vectors must be equal length")
(nvtx == 0 || length(f_ss) == 0) && return StaticDiGraph(UInt8[], UInt8[1], UInt8[], UInt8[1])
f_ind = [searchsortedfirst(f_ss, x) for x in Base.OneTo(nvtx)]
push!(f_ind, length(f_ss)+1)
b_ind = [searchsortedfirst(b_ss, x) for x in Base.OneTo(nvtx)]
push!(b_ind, length(b_ss)+1)
T = mintype(maximum(f_ds))
U = mintype(f_ind[end])
return StaticDiGraph{T, U}(
convert(Vector{T}, f_ds),
convert(Vector{U}, f_ind),
convert(Vector{T}, b_ds),
convert(Vector{U}, b_ind)
)
end
# sorted src, dst tuples for forward and backward
function StaticDiGraph(nvtx::I, f_sd::Vector{Tuple{T, T}}, b_sd::Vector{Tuple{T, T}}) where {T<:Integer,I<:Integer}
f_ss = [x[1] for x in f_sd]
f_ds = [x[2] for x in f_sd]
b_ss = [x[1] for x in b_sd]
b_ds = [x[2] for x in b_sd]
return StaticDiGraph(nvtx, f_ss, f_ds, b_ss, b_ds)
end
function StaticDiGraph(g::Graphs.SimpleGraphs.SimpleDiGraph)
ne(g) == 0 && return StaticDiGraph(nv(g), Array{Tuple{UInt8, UInt8},1}(), Array{Tuple{UInt8, UInt8},1}())
f_sd = [Tuple(e) for e in edges(g)]
b_sd = sort([Tuple(reverse(e)) for e in edges(g)])
return StaticDiGraph(nv(g), f_sd, b_sd)
end
function StaticDiGraph()
return StaticDiGraph(UInt8[], UInt8[1], UInt8[], UInt8[1])
end
function StaticDiGraph{T, U}(s::StaticDiGraph) where T <: Integer where U <: Integer
new_fvec = T.(s.f_vec)
new_find = U.(s.f_ind)
new_bvec = T.(s.b_vec)
new_bind = U.(s.b_ind)
return StaticDiGraph(new_fvec, new_find, new_bvec, new_bind)
end
==(g::StaticDiGraph, h::StaticDiGraph) = g.f_vec == h.f_vec && g.f_ind == h.f_ind && g.b_vec == h.b_vec && g.b_ind == h.b_ind
degree(g::StaticDiGraph, v::Integer) = indegree(g, v) + outdegree(g, v)
degree(g::StaticDiGraph) = [degree(g, v) for v in vertices(g)]
indegree(g::StaticDiGraph, v::Integer) = length(_bvrange(g, v))
indegree(g::StaticDiGraph) = [indegree(g, v) for v in vertices(g)]
outdegree(g::StaticDiGraph, v::Integer) = length(_fvrange(g, v))
outdegree(g::StaticDiGraph) = [outdegree(g, v) for v in vertices(g)]
"""
is_directed(g)
Return `true` if `g` is a directed graph.
"""
is_directed(::Type{StaticDiGraph}) = true
is_directed(::Type{StaticDiGraph{T}}) where T = true
is_directed(::Type{StaticDiGraph{T, U}}) where T where U = true
is_directed(g::StaticDiGraph) = true
reverse(g::StaticDiGraph) = StaticDiGraph(copy(g.b_vec), copy(g.b_ind), copy(g.f_vec), copy(g.f_ind))
| StaticGraphs | https://github.com/JuliaGraphs/StaticGraphs.jl.git |
|
[
"MIT"
] | 0.3.0 | 855371d8fdfaed46dbb32a7c57a42db4441b9247 | code | 2554 |
"""
StaticGraph{T, U} <: AbstractStaticGraph{T, U}
A type representing an undirected static graph.
"""
struct StaticGraph{T<:Integer, U<:Integer} <: AbstractStaticGraph{T, U}
f_vec::Vector{T}
f_ind::Vector{U}
end
# sorted src, dst vectors
# note: this requires reverse edges included in the sorted vector.
function StaticGraph(nvtx::I, ss::AbstractVector{S}, ds::AbstractVector{D}) where {I<:Integer,S<:Integer,D<:Integer}
length(ss) != length(ds) && error("source and destination vectors must be equal length")
(nvtx == 0 || length(ss) == 0) && return StaticGraph()
f_ind = [searchsortedfirst(ss, x) for x in Base.OneTo(nvtx)]
push!(f_ind, length(ss)+1)
T = mintype(maximum(ds))
U = mintype(f_ind[end])
return StaticGraph{T, U}(convert(Vector{T},ds), convert(Vector{U}, f_ind))
end
function StaticGraph{T, U}(s::StaticGraph) where T <: Integer where U <: Integer
new_fvec = T.(s.f_vec)
new_find = U.(s.f_ind)
return StaticGraph(new_fvec, new_find)
end
# sorted src, dst tuples
function StaticGraph(nvtx::I, sd::Vector{Tuple{T, T}}) where {T<:Integer, I<:Integer}
ss = [x[1] for x in sd]
ds = [x[2] for x in sd]
return StaticGraph(nvtx, ss, ds)
end
function StaticGraph(g::Graphs.SimpleGraphs.SimpleGraph)
ne(g) == 0 && return StaticGraph(nv(g), Array{Tuple{UInt8, UInt8},1}())
sd1 = [Tuple(e) for e in edges(g)]
ds1 = [Tuple(reverse(e)) for e in edges(g)]
sd = sort(vcat(sd1, ds1))
return StaticGraph(nv(g), sd)
end
function StaticGraph()
return StaticGraph(UInt8[], UInt8[1])
end
badj(g::StaticGraph, s) = fadj(g, s)
badj(g::StaticGraph) = fadj(g)
ne(g::StaticGraph{T, U}) where T where U = U(length(g.f_vec) ÷ 2)
function has_edge(e::StaticGraphEdge, g::StaticGraph)
u, v = Tuple(e)
(u > nv(g) || v > nv(g)) && return false
if degree(g, u) > degree(g, v)
u, v = v, u
end
return insorted(v, fadj(g, u))
end
==(g::StaticGraph, h::StaticGraph) = g.f_vec == h.f_vec && g.f_ind == h.f_ind
degree(g::StaticGraph{T, U}, v::Integer) where T where U = T(length(_fvrange(g, v)))
degree(g::StaticGraph) = [degree(g, v) for v in vertices(g)]
indegree(g::StaticGraph, v::Integer) = degree(g, v)
indegree(g::StaticGraph) = degree(g)
outdegree(g::StaticGraph, v::Integer) = degree(g, v)
outdegree(g::StaticGraph) = degree(g)
"""
is_directed(g)
Return `true` if `g` is a directed graph.
"""
is_directed(::Type{StaticGraph}) = false
is_directed(::Type{StaticGraph{T, U}}) where T where U = false
is_directed(g::StaticGraph) = false
| StaticGraphs | https://github.com/JuliaGraphs/StaticGraphs.jl.git |
|
[
"MIT"
] | 0.3.0 | 855371d8fdfaed46dbb32a7c57a42db4441b9247 | code | 1507 | struct UnsafeVectorView{T,U} <: AbstractVector{T}
offset::U
len::U
ptr::Ptr{T}
end
@inline UnsafeVectorView(parent::Union{Vector, Base.FastContiguousSubArray}, range::UnitRange) = UnsafeVectorView(start(range) - 1, length(range), pointer(parent))
@inline Base.size(v::UnsafeVectorView) = (v.len,)
@inline Base.getindex(v::UnsafeVectorView, idx) = unsafe_load(v.ptr, idx + v.offset)
@inline Base.setindex!(v::UnsafeVectorView, value, idx) = unsafe_store!(v.ptr, value, idx + v.offset)
@inline Base.length(v::UnsafeVectorView) = v.len
Base.IndexStyle(::Type{V}) where {V <: UnsafeVectorView} = IndexLinear()
"""
UnsafeVectorView only works for isbits types. For other types, we're already
allocating lots of memory elsewhere, so creating a new SubArray is fine.
This function looks type-unstable, but the isbits(T) test can be evaluated
by the compiler, so the result is actually type-stable.
From https://github.com/rdeits/NNLS.jl/blob/0a9bf56774595b5735bc738723bd3cb94138c5bd/src/NNLS.jl#L218.
"""
@inline function fastview(parent::Union{Vector{T}, Base.FastContiguousSubArray{T}}, range::UnitRange) where T
if isbits(T)
UnsafeVectorView(parent, range)
else
view(parent, range)
end
end
"""
mintype(v)
Returns the minimum integer type required to represent integer `v`.
"""
function mintype(v::T) where T <: Integer
validtypes = [UInt8, UInt16, UInt32, UInt64, UInt128]
for U in validtypes
v <= typemax(U) && return U
end
return T
end
| StaticGraphs | https://github.com/JuliaGraphs/StaticGraphs.jl.git |
|
[
"MIT"
] | 0.3.0 | 855371d8fdfaed46dbb32a7c57a42db4441b9247 | code | 5361 | using StaticGraphs
using Graphs
using Graphs.SimpleGraphs
using Test
const testdir = dirname(@__FILE__)
@testset "StaticGraphs" begin
hu = loadgraph(joinpath(testdir, "testdata", "house-uint8.jsg"), SGFormat())
dhu = loadgraph(joinpath(testdir, "testdata", "pathdg-uint8.jsg"), SDGFormat())
@testset "staticgraph" begin
@test sprint(show, StaticGraph(Graph())) == "{0, 0} undirected simple static {UInt8, UInt8} graph"
g = smallgraph(:house)
gu = squash(g)
sg = StaticGraph(g)
sgu = StaticGraph(gu)
gempty = StaticGraph()
gdempty = StaticDiGraph()
@test eltype(StaticGraph{UInt128, UInt128}(sgu)) == UInt128
@test sprint(show, sg) == "{5, 6} undirected simple static {UInt8, UInt8} graph"
@test sprint(show, sgu) == "{5, 6} undirected simple static {UInt8, UInt8} graph"
testfn(fn, args...) =
@inferred(fn(hu, args...)) ==
@inferred(fn(sg, args...)) ==
@inferred(fn(sgu, args...)) ==
fn(g, args...)
@test hu == sg == sgu
@test @inferred eltype(hu) == UInt8
@test testfn(ne)
@test testfn(nv)
@test testfn(inneighbors, 1)
@test testfn(outneighbors, 1)
@test testfn(vertices)
@test testfn(degree)
@test testfn(degree, 1)
@test testfn(indegree)
@test testfn(indegree, 1)
@test testfn(outdegree)
@test testfn(outdegree, 1)
@test @inferred has_edge(hu, 1, 3)
@test @inferred has_edge(hu, 3, 1)
@test @inferred !has_edge(hu, 2, 3)
@test @inferred !has_edge(hu, 3, 2)
@test @inferred !has_edge(hu, 1, 10)
@test @inferred has_vertex(hu, 1)
@test @inferred !has_vertex(hu, 10)
@test @inferred !is_directed(hu)
@test @inferred !is_directed(StaticGraph)
@test @inferred collect(edges(hu)) == collect(edges(sg))
@test @inferred StaticGraphs.fadj(hu) == [StaticGraphs.fadj(hu, x) for x in vertices(hu)]
@test @inferred StaticGraphs.badj(hu) == StaticGraphs.fadj(hu)
(g1, m1) = @inferred induced_subgraph(hu, [3,2,1])
g2 = @inferred hu[3:-1:1]
@test g1 == g2
@test m1 == [3,2,1]
z = @inferred(adjacency_matrix(hu, Bool, dir=:out))
@test z[1,2]
@test !z[1,4]
@test z == adjacency_matrix(hu, Bool, dir=:in) == adjacency_matrix(hu, Bool, dir=:both)
# empty constructors
@test nv(gempty) === 0x00
@test typeof(Graphs.nv(gempty)) == UInt8
@test length(Graphs.edges(gempty)) === 0x00
@test nv(gdempty) === 0x00
@test length(Graphs.edges(gdempty)) === 0x00
end # staticgraph
@testset "staticdigraph" begin
@test sprint(show, StaticDiGraph(DiGraph())) == "{0, 0} directed simple static {UInt8, UInt8} graph"
dg = path_digraph(5)
dgu = squash(dg)
dsg = StaticDiGraph(dg)
dsgu = StaticDiGraph(dgu)
@test eltype(StaticDiGraph{UInt128, UInt128}(dsgu)) == UInt128
@test sprint(show, dsg) == "{5, 4} directed simple static {UInt8, UInt8} graph"
@test sprint(show, dsgu) == "{5, 4} directed simple static {UInt8, UInt8} graph"
dhu = loadgraph(joinpath(testdir, "testdata", "pathdg-uint8.jsg"), SDGFormat())
dtestfn(fn, args...) =
@inferred(fn(dhu, args...)) ==
@inferred(fn(dsg, args...)) ==
@inferred(fn(dsgu, args...)) ==
fn(dg, args...)
@test dhu == dsg == dsgu
@test @inferred eltype(dhu) == UInt8
@test dtestfn(ne)
@test dtestfn(nv)
@test dtestfn(inneighbors, 1)
@test dtestfn(outneighbors, 1)
@test dtestfn(vertices)
@test dtestfn(degree)
@test dtestfn(degree, 1)
@test dtestfn(indegree)
@test dtestfn(indegree, 1)
@test dtestfn(outdegree)
@test dtestfn(outdegree, 1)
@test @inferred has_edge(dhu, 1, 2)
@test @inferred !has_edge(dhu, 2, 1)
@test @inferred !has_edge(dhu, 1, 10)
@test @inferred has_vertex(dhu, 1)
@test @inferred !has_vertex(dhu, 10)
@test @inferred is_directed(dhu)
@test @inferred is_directed(StaticDiGraph)
@test @inferred collect(edges(dhu)) == collect(edges(dsg))
@test @inferred StaticGraphs.fadj(dhu) == [StaticGraphs.fadj(dhu, x) for x in vertices(dhu)]
@test @inferred StaticGraphs.badj(dhu) == [StaticGraphs.badj(dhu, x) for x in vertices(dhu)]
(g1, m1) = @inferred induced_subgraph(dhu, [3,2,1])
g2 = @inferred dhu[3:-1:1]
@test g1 == g2
@test m1 == [3,2,1]
z = @inferred(adjacency_matrix(dhu, Bool, dir=:out))
@test z[1,2]
@test !z[2,1]
z = @inferred(adjacency_matrix(dhu, Bool, dir=:in))
@test z[2,1]
@test !z[1,2]
@test_logs (:warn, r".*") adjacency_matrix(dhu, Bool, dir=:both) == adjacency_matrix(dhu, Bool)
end # staticdigraph
@testset "utils" begin
@test StaticGraphs.mintype(BigInt(1e100)) == BigInt
end # utils
@testset "persistence" begin
function writegraphs(f, fio)
@test savegraph(f, hu) == 1
@test savegraph(f, dhu) == 1
end
mktemp(writegraphs)
end
end # StaticGraphs
| StaticGraphs | https://github.com/JuliaGraphs/StaticGraphs.jl.git |
|
[
"MIT"
] | 0.3.0 | 855371d8fdfaed46dbb32a7c57a42db4441b9247 | docs | 578 | # StaticGraphs
[](https://github.com/JuliaGraphs/StaticGraphs.jl/actions?query=workflow%3ACI+branch%3Amaster)
[](http://codecov.io/github/JuliaGraphs/StaticGraphs.jl?branch=master)
Memory-efficient, performant graph structures optimized for large networks.
Uses [Graphs](https://github.com/JuliaGraphs/Graphs.jl).
Note: adding/removing edges and vertices is not supported with this graph type.
| StaticGraphs | https://github.com/JuliaGraphs/StaticGraphs.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 318 | using Documenter, SDFReader
makedocs(
sitename = "SDFReader",
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true"
),
pages = [
"index.md",
],
modules = [SDFReader]
)
deploydocs(
repo = "github.com/SebastianM-C/SDFReader.jl",
push_preview = true
)
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 1919 | module SDFReader
export header, Header,
file_summary,
cached_read,
labels,
Stagger, CellCentre, FaceX, FaceY, FaceZ, EdgeX, EdgeY, EdgeZ, Vertex,
AbstractBlockHeader,
PlainVariableBlockHeader,
PointVariableBlockHeader,
PlainMeshBlockHeader,
PointMeshBlockHeader,
DiskArrayVariable, DiskArrayMesh,
MmapedVariable, MmapedParticleMesh,
mmap_block
using Unitful: uparse
using DiskArrays: DiskArrays, AbstractDiskArray, Chunked
using Mmap: mmap
using TiledIteration: TiledIteration, padded_tilesize, TileIterator, SplitAxis
include("constants.jl")
include("sdf_header.jl")
include("read_header.jl")
include("read_data.jl")
include("cache.jl")
include("units.jl")
include("utils.jl")
include("read_chunk.jl")
include("mmap.jl")
@generated function typemap(data_type::Val{N})::DataType where {N}
if N == DATATYPE_NULL
Nothing
elseif N == DATATYPE_INTEGER4
Int32
elseif N == DATATYPE_INTEGER8
Int64
elseif N == DATATYPE_REAL4
Float32
elseif N == DATATYPE_REAL8
Float64
elseif N == DATATYPE_REAL16
Nothing # unsupported
elseif N == DATATYPE_CHARACTER
Char
elseif N == DATATYPE_LOGICAL
Bool
else
Nothing
end
end
file_summary(filename) = open(file_summary, filename)[2]
function file_summary(f::IOStream)
h = header(f)
blocks = Dict{String,AbstractBlockHeader}()
block_start = h.summary_location
for i in Base.OneTo(h.nblocks)
block = BlockHeader(f, block_start, h.string_length, h.block_header_length)
blocks = push!(blocks, block.id => read(f, block))
block_start = block.next_block_location
end
h, blocks
end
function Base.read(f::IO, block::AbstractBlockHeader{T,D}) where {T,D}
raw_data = read!(f, block)
apply_normalization!(raw_data, block)
return add_units(raw_data, block)
end
end # module
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 476 | skipcache(::Any) = false
skipcache(::Type{<:ConstantBlockHeader}) = true
skipcache(::Type{<:RunInfoBlockHeader}) = true
skipcache(::Type{<:CPUSplitBlockHeader}) = true
skipcache(::Type{<:PlainMeshBlockHeader}) = true
function cached_read(f, block, cache)
skipcache(typeof(block)) && return read(f, block)
raw_data = get!(cache, (f.name, block)) do
read!(f, block)
end
apply_normalization!(raw_data, block)
return add_units(raw_data, block)
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 1686 | const ID_LENGTH = 32
const ENDIANNESS = 16911887
const SDF_VERSION = 1
const SDF_REVISION = 4
const SDF_MAGIC = "SDF1"
const BLOCKTYPE_SCRUBBED = Int32(-1)
const BLOCKTYPE_NULL = Int32(0)
const BLOCKTYPE_PLAIN_MESH = Int32(1)
const BLOCKTYPE_POINT_MESH = Int32(2)
const BLOCKTYPE_PLAIN_VARIABLE = Int32(3)
const BLOCKTYPE_POINT_VARIABLE = Int32(4)
const BLOCKTYPE_CONSTANT = Int32(5)
const BLOCKTYPE_ARRAY = Int32(6)
const BLOCKTYPE_RUN_INFO = Int32(7)
const BLOCKTYPE_SOURCE = Int32(8)
const BLOCKTYPE_STITCHED_TENSOR = Int32(9)
const BLOCKTYPE_STITCHED_MATERIAL = Int32(10)
const BLOCKTYPE_STITCHED_MATVAR = Int32(11)
const BLOCKTYPE_STITCHED_SPECIES = Int32(12)
const BLOCKTYPE_SPECIES = Int32(13)
const BLOCKTYPE_PLAIN_DERIVED = Int32(14)
const BLOCKTYPE_POINT_DERIVED = Int32(15)
const BLOCKTYPE_CONTIGUOUS_TENSOR = Int32(16)
const BLOCKTYPE_CONTIGUOUS_MATERIAL = Int32(17)
const BLOCKTYPE_CONTIGUOUS_MATVAR = Int32(18)
const BLOCKTYPE_CONTIGUOUS_SPECIES = Int32(19)
const BLOCKTYPE_CPU_SPLIT = Int32(20)
const BLOCKTYPE_STITCHED_OBSTACLE_GROUP = Int32(21)
const BLOCKTYPE_UNSTRUCTURED_MESH = Int32(22)
const BLOCKTYPE_STITCHED = Int32(23)
const BLOCKTYPE_CONTIGUOUS = Int32(24)
const BLOCKTYPE_LAGRANGIAN_MESH = Int32(25)
const BLOCKTYPE_STATION = Int32(26)
const BLOCKTYPE_STATION_DERIVED = Int32(27)
const BLOCKTYPE_DATABLOCK = Int32(28)
const BLOCKTYPE_NAMEVALUE = Int32(29)
const DATATYPE_NULL = Int32(0)
const DATATYPE_INTEGER4 = Int32(1)
const DATATYPE_INTEGER8 = Int32(2)
const DATATYPE_REAL4 = Int32(3)
const DATATYPE_REAL8 = Int32(4)
const DATATYPE_REAL16 = Int32(5)
const DATATYPE_CHARACTER = Int32(6)
const DATATYPE_LOGICAL = Int32(7)
const DATATYPE_OTHER = Int32(8)
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 2616 | abstract type AbstractMmapedEntry{T,N} <: AbstractArray{T,N} end
struct MmapedVariable{T,N,B<:AbstractBlockHeader{T,N},I,M} <: AbstractMmapedEntry{T,N}
block::B
chunksize::NTuple{N,Int}
io::I
mm::M
end
auto_kernel_size(::AbstractBlockHeader{T,1}) where {T} = (100,)
auto_kernel_size(::AbstractBlockHeader{T,2}) where {T} = (50, 50)
auto_kernel_size(::AbstractBlockHeader{T,3}) where {T} = (20, 20, 20)
function MmapedVariable(
file::IO,
block::Union{PlainVariableBlockHeader,PointVariableBlockHeader},
kernel_size=auto_kernel_size(block)
)
dims = Int.(size(block))
n = prod(dims) * sizeof(eltype(block))
offset = get_offset(block)
chunksize = padded_tilesize(Float64, kernel_size)
mm = mmap(file, Vector{UInt8}, n, offset)
restored_type_mm = reinterpret(eltype(block), mm)
reshapd_mm = reshape(restored_type_mm, dims)
MmapedVariable(block, chunksize, file, reshapd_mm)
end
# PlainMeshBlockHeader is the mesh given by the "grid" block (the grid for fields),
# there's no need to mmap it, we can just represtent it with a range
struct MmapedParticleMesh{T,N,B<:PointMeshBlockHeader{T,N},I,M} <: AbstractMmapedEntry{T,1}
block::B
chunksize::Tuple{Int}
axis::Int
io::I
mm::M
end
Base.size(pm::MmapedParticleMesh) = (size(pm.block, pm.axis),)
function MmapedParticleMesh(file::IO, block::PointMeshBlockHeader, axis::Int, kernel_size=(1000,))
dims = Int(size(block, axis))
n = dims * sizeof(eltype(block))
offset = get_offset(block, axis)
chunksize = padded_tilesize(Float64, kernel_size)
mm = mmap(file, Vector{UInt8}, n, offset)
restored_type_mm = reinterpret(eltype(block), mm)
MmapedParticleMesh(block, chunksize, axis, file, restored_type_mm)
end
# AbstractArray interface
Base.size(ame::AbstractMmapedEntry) = size(ame.block)
Base.IndexStyle(::Type{<:AbstractMmapedEntry}) = IndexLinear()
Base.@propagate_inbounds Base.getindex(ame::AbstractMmapedEntry, i::Int) = ame.mm[i]
# TiledIteration
TiledIteration.TileIterator(ame::AbstractMmapedEntry) = TileIterator(axes(ame), ame.chunksize)
TiledIteration.SplitAxis(ame::AbstractMmapedEntry, d) = SplitAxis(axes(ame, d), ame.chunksize[d])
mmap_block(file::IO, block::Union{PlainVariableBlockHeader,PointVariableBlockHeader}, ks=auto_kernel_size(block)) = MmapedVariable(file, block, ks)
mmap_block(file::IO, block::PointMeshBlockHeader, ax, ks=(1000,)) = MmapedParticleMesh(file, block, ax, ks)
mmap_block(::IO, ::PlainMeshBlockHeader, args...) = error("There is no need to mmap this block type.")
mmap_block(args...) = error("Unknown block type")
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 2691 | struct DiskArrayVariable{T,N,B,S} <: AbstractDiskArray{T,N}
stream::S
block::B
chunksize::NTuple{N,Int}
end
function DiskArrayVariable{T}(file::S, block::B, chunksize::NTuple{N,Int}) where {T,N,B,S}
DiskArrayVariable{T,N,B,S}(file, block, chunksize)
end
function DiskArrayVariable(file::IO, block::Union{PointVariableBlockHeader,PlainVariableBlockHeader}; chunksize=Int.(size(block)))
DiskArrayVariable{eltype(block)}(file, block, chunksize)
end
struct DiskArrayMesh{T,N,B,S} <: AbstractDiskArray{T,N}
stream::S
block::B
axis::Int
chunksize::NTuple{N,Int}
end
function DiskArrayMesh{T}(file::S, block::B, axis, chunksize::NTuple{N,Int}) where {T,N,B,S}
DiskArrayMesh{T,N,B,S}(file, block, axis, chunksize)
end
function DiskArrayMesh(file::IO, block::Union{PointMeshBlockHeader,PlainMeshBlockHeader}, axis; chunksize=(Int(size(block, axis)),))
DiskArrayMesh{eltype(block)}(file, block, axis, chunksize)
end
DiskArrays.haschunks(::DiskArrayVariable) = Chunked()
DiskArrays.haschunks(::DiskArrayMesh) = Chunked()
Base.size(a::DiskArrayVariable) = size(a.block)
Base.size(a::DiskArrayMesh) = (size(a.block)[a.axis],)
function check_continuous(linear_idxs)
vec_idxs = vec(linear_idxs)
@debug "Linear indices to read: $linear_idxs"
length(linear_idxs) == 1 && return nothing
mapreduce(isone, &, diff(vec_idxs, dims=1)) || error("Can only read contiguous regions.")
return nothing
end
function readchunk!(stream, aout, linear_idxs, T, offset)
check_continuous(linear_idxs)
start_idx = first(linear_idxs)
n = length(linear_idxs)
@debug "Starting to read $n elements of type $T from $start_idx"
target_nb = sizeof(T) * n
raw_data = reinterpret(UInt8, vec(aout))
seek(stream, offset + (start_idx - 1) * sizeof(T))
nb = readbytes!(stream, raw_data, target_nb)
target_nb ≠ nb && @warn "Read only $nb bytes instead of $target_nb"
return nothing
end
# This covers PointVariableBlockHeader and PlainVariableBlockHeader
function DiskArrays.readblock!(a::DiskArrayVariable, aout, idxs::AbstractUnitRange...)
ndims(a) == length(idxs) || error("Number of indices is not correct")
all(r -> isa(r, AbstractUnitRange), idxs) || error("Not all indices are unit ranges")
stream, block = a.stream, a.block
linear_idxs = LinearIndices(a)[idxs...]
offset = get_offset(block)
readchunk!(stream, aout, linear_idxs, eltype(block), offset)
end
function DiskArrays.readblock!(a::DiskArrayMesh{T}, aout, idxs::AbstractUnitRange) where T
stream, block = a.stream, a.block
axis = a.axis
offset = get_offset(block, axis)
readchunk!(stream, aout, idxs, T, offset)
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 1295 | function Base.read!(f::IO, block::ConstantBlockHeader{T}) where T
block.val
end
function Base.read!(f::IO, block::PlainMeshBlockHeader{T,D}) where {T,D}
offset = get_offset(block)
raw_data = ntuple(Val(D)) do i
Array{T, 1}(undef, block.dims[i])
end
@inbounds for i in eachindex(raw_data)
seek(f, offset)
offset += sizeof(T) * block.dims[i]
read!(f, raw_data[i])
end
return raw_data
end
function Base.read!(f::IO, block::PointMeshBlockHeader{T,D}) where {T,D}
offset = get_offset(block)
raw_data = ntuple(Val(D)) do _
Array{T, 1}(undef, block.np)
end
@inbounds for i in eachindex(raw_data)
seek(f, offset)
offset += sizeof(T) * block.np
read!(f, raw_data[i])
end
return raw_data
end
function Base.read!(f::IO, block::PlainVariableBlockHeader{T}) where T
dim = prod(Int64.(block.dims))
raw_data = Array{T, 1}(undef, dim)
seek(f, get_offset(block))
read!(f, raw_data)
reshape(raw_data, block.dims)
end
function Base.read!(f::IO, block::PointVariableBlockHeader{T}) where T
raw_data = Array{T, 1}(undef, block.np)
seek(f, get_offset(block))
read!(f, raw_data)
end
function Base.read!(f::IO, block::RunInfoBlockHeader{T,D}) where {T,D}
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 3756 | function header(f::IOStream)
sdf_magic = simple_str(read(f, 4))
endianness = read(f, Int32)
file_version = read(f, Int32)
file_revision = read(f, Int32)
code_name = simple_str(read(f, ID_LENGTH))
first_block_location = read(f, Int64)
summary_location = read(f, Int64)
summary_size = read(f, Int32)
nblocks = read(f, Int32)
block_header_length = read(f, Int32)
step = read(f, Int32)
time = read(f, Float64)
jobid1 = read(f, Int32)
jobid2 = read(f, Int32)
string_length = read(f, Int32)
code_io_version = read(f, Int32)
Header(
sdf_magic,
endianness,
file_version,
file_revision,
code_name,
first_block_location,
summary_location,
summary_size,
nblocks,
block_header_length,
step,
time,
jobid1,
jobid2,
string_length,
code_io_version,
)
end
header(filename::AbstractString) = open(header, filename)
function Base.read(f, block::BlockHeader{T,D,BLOCKTYPE_CONSTANT}) where {T,D}
val = read(f, T)
ConstantBlockHeader(block, val)
end
function Base.read(f, block::BlockHeader{T,N,BLOCKTYPE_PLAIN_MESH}) where {T,N}
dims = Array{Int32, 1}(undef, N)
mults, labels, units, geometry, minval, maxval = read_mesh_common!(f,N)
read!(f, dims)
PlainMeshBlockHeader(
block,
mults,
labels,
units,
geometry,
minval,
maxval,
dims,
)
end
function Base.read(f, block::BlockHeader{T,N,BLOCKTYPE_POINT_MESH}) where {T,N}
mults, labels, units, geometry, minval, maxval = read_mesh_common!(f,N)
np = read(f, Int64)
PointMeshBlockHeader(
block,
mults,
labels,
units,
geometry,
minval,
maxval,
np,
)
end
function Base.read(f, block::BlockHeader{T,D,BLOCKTYPE_PLAIN_VARIABLE}) where {T,D}
dims = Array{Int32, 1}(undef, D)
mult, units, mesh_id = read_variable_common!(f)
read!(f, dims)
stagger = Stagger(read(f, Int32))
PlainVariableBlockHeader(block, mult, units, mesh_id, Tuple(dims), stagger)
end
function Base.read(f, block::BlockHeader{T,D,BLOCKTYPE_POINT_VARIABLE}) where {T,D}
mult, units, mesh_id = read_variable_common!(f)
np = read(f, Int64)
PointVariableBlockHeader(block, mult, units, mesh_id, np)
end
function Base.read(f, block::BlockHeader{T,D,BLOCKTYPE_RUN_INFO}) where {T,D}
code_version = read(f, Int32)
code_revision = read(f, Int32)
commit_id = simple_str(read(f, ID_LENGTH))
sha1sum = simple_str(read(f, ID_LENGTH))
compile_machine = simple_str(read(f, ID_LENGTH))
compile_flags = simple_str(read(f, ID_LENGTH))
defines = read(f, Int64)
compile_date = read(f, Int32)
run_date = read(f, Int32)
io_date = read(f, Int32)
# TODO save these fields
RunInfoBlockHeader(block)
end
function Base.read(f, block::BlockHeader{T,D,BLOCKTYPE_CPU_SPLIT}) where {T,D}
CPUSplitBlockHeader(block)
end
function read_variable_common!(f)
mult = read(f, Float64)
units = simple_str(read(f, ID_LENGTH))
mesh_id = simple_str(read(f, ID_LENGTH))
mult, units, mesh_id
end
function read_mesh_common!(f, n)
minval = Array{Float64, 1}(undef, n)
maxval = Array{Float64, 1}(undef, n)
mults = ntuple(n) do i
read(f, Float64)
end
labels = ntuple(n) do i
simple_str(read(f, ID_LENGTH))
end
units = ntuple(n) do i
simple_str(read(f, ID_LENGTH))
end
geometry = Geometry(read(f, Int32))
read!(f, minval)
read!(f, maxval)
mults, labels, units, geometry, minval, maxval
end
simple_str(s) = replace(String(rstrip(String(s))), "\0" => "")
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 10553 | struct Header
sdf_magic::String
endianness::Int32
file_version::Int32
file_revision::Int32
code_name::String
first_block_location::Int64
summary_location::Int64
summary_size::Int32
nblocks::Int32
block_header_length::Int32
step::Int32
time::Float64
jobid1::Int32
jobid2::Int32
string_length::Int32
code_io_version::Int32
end
# T Data type
# N Dimensionality of data
# B Dispatch puropeses (in read for choosing block type)
struct BlockHeader{T,N,B}
next_block_location::Int64
data_location::Int64
id::String
data_length::Int64
name::String
end
function BlockHeader(f::IOStream, start, string_length, header_length)
seek(f, start)
next_block_location = read(f, Int64)
data_location = read(f, Int64)
id = simple_str(read(f, ID_LENGTH))
data_length = read(f, Int64)
block_type = read(f, Int32)
data_type = read(f, Int32)
n_dims = read(f, Int32)
name = simple_str(read(f, string_length))
d_type = typemap(Val(data_type))
seek(f, start + header_length)
BlockHeader{d_type,Int(n_dims),block_type}(
next_block_location,
data_location,
id,
data_length,
name,
)
end
abstract type AbstractBlockHeader{T,N} end
Base.ndims(::AbstractBlockHeader{T,N}) where {T,N} = N
Base.eltype(::AbstractBlockHeader{T}) where {T} = T
Base.nameof(block::BlockHeader) = block.name
struct ConstantBlockHeader{T,N} <: AbstractBlockHeader{T,N}
base_header::BlockHeader{T,N}
val::T
end
struct CPUSplitBlockHeader{T,N} <: AbstractBlockHeader{T,N}
base_header::BlockHeader{T,N}
end
@enum Geometry begin
Null = 0
Cartesian = 1
Cylindrical = 2
Spherical = 3
end
@doc """
PlainMeshBlockHeader{T,N}
A mesh defines the locations at which variables are defined.
Since the geometry of a problem is fixed and most variables will be defined
at positions relative to a fixed grid, it makes sense to write this
position data once in its own block.
Each variable will then refer to one of these mesh blocks to provide their location data.
The `PlainMeshBlockHeader` is used for representing the positions at which
scalar field discretizations are defined.
The block header contains the `base_header` (a `BlockHeader`) and the following metadata
- `mults`: The normalisation factor applied to the grid data
in each direction.
- `labels`: The axis labels for this grid in each direction.
- `units`: The units for this grid in each direction after the
normalisation factors have been applied.
- `geometry`: The geometry of the block.
- `minval`: The minimum coordinate values in each direction.
- `maxval`: The maximum coordinate values in each direction.
The geometry of the block can take the following values
- `Null`: Unspecified geometry. This is an error.
- `Cartesian`: Cartesian geometry.
- `Cylindrical`: Cylindrical geometry.
- `Spherical`: Spherical geometry.
The last item in the header is `dims`, is the number of grid points in
each dimension.
The data written is the locations of node points for the mesh in each
of the simulation dimensions.
Therefore for a 3d simulation of resolution ``(nx; ny; nz)``, the data will consist of
a 1d array of X positions with ``(nx + 1)`` elements followed by
a 1d array of Y positions with ``(ny + 1)`` elements and finally
a 1d array of Z positions with ``(nz + 1)`` elements.
Here the resolution specifies the number of simulation cells and therefore
the nodal values have one extra element. In a 1d or 2d simulation, you would
write only the X or X and Y arrays respectively.
"""
struct PlainMeshBlockHeader{T,N} <: AbstractBlockHeader{T,N}
base_header::BlockHeader{T}
mults::NTuple{N,Float64}
labels::NTuple{N,String}
units::NTuple{N,String}
geometry::Geometry
minval::Array{Float64,1}
maxval::Array{Float64,1}
dims::Array{Int32,1}
end
function Base.size(block::PlainMeshBlockHeader{T,N}) where {T,N}
ntuple(Val(N)) do i
block.dims[i]
end
end
Base.size(block::PlainMeshBlockHeader, i::Int) = block.dims[i]
@doc """
PointMeshBlockHeader{T,N}
A mesh defines the locations at which variables are defined.
Since the geometry of a problem is fixed and most variables will be defined
at positions relative to a fixed grid, it makes sense to write this
position data once in its own block.
Each variable will then refer to one of these mesh blocks to provide their location data.
The `PointMeshBlockHeader` is used for representing the positions at which
vector field discretizations are defined.
The block header contains the `base_header` (a `BlockHeader`) and the following metadata
- `mults`: The normalisation factor applied to the grid data
in each direction.
- `labels`: The axis labels for this grid in each direction.
- `units`: The units for this grid in each direction after the
normalisation factors have been applied.
- `geometry`: The geometry of the block.
- `minval`: The minimum coordinate values in each direction.
- `maxval`: The maximum coordinate values in each direction.
- `np`: The number of points.
The geometry of the block can take the following values
- `Null`: Unspecified geometry. This is an error.
- `Cartesian`: Cartesian geometry.
- `Cylindrical`: Cylindrical geometry.
- `Spherical`: Spherical geometry.
The data written is the locations of each point in the first direction followed by
the locations in the second direction and so on.
Thus, for a 3d simulation, if we define the first point as having coordinates
``(x_1; y_1; x_1)`` and the second point as ``(x_2; y_2; z_2)``, etc.
then the data written to file is a 1d array with
elements ``(x_1; x_2; \\dots; x_{np})``, followed by
the array ``(y_1; y_2; \\dots; y_{np})`` and finally
the array ``(z_1; z_2; \\dots; z_{np})`` where ``np`` corresponds to the
number of points in the mesh. For a 1d simulation, only the x array is written
and for a 2d simulation only the x and y arrays are written.
"""
struct PointMeshBlockHeader{T,N} <: AbstractBlockHeader{T,N}
base_header::BlockHeader{T,N}
mults::NTuple{N,Float64}
labels::NTuple{N,String}
units::NTuple{N,String}
geometry::Geometry
minval::Array{Float64,1}
maxval::Array{Float64,1}
np::Int64
end
Base.size(block::PointMeshBlockHeader{T,D}) where {T,D} = ntuple(_ -> block.np, Val(D))
Base.size(block::PointMeshBlockHeader, ::Int) = block.np
@enum Stagger begin
CellCentre = 0
FaceX = 1
FaceY = 2
FaceZ = 4
EdgeX = 6
EdgeY = 5
EdgeZ = 3
Vertex = 7
end
@doc """
PlainVariableBlockHeader{T,N}
The `PlainVariableBlockHeader` is used to describe a variable which is
located relative to the points given in a mesh block.
The block header contains the `base_header` (a `BlockHeader`) and the following metadata
- `mult`: The normalisation factor applied to the variable data.
- `units`: The units for this variable after the normalisation factor has
been applied.
- `mesh_id`: The name(`id`) of the mesh relative to which this block's data is defined.
- `dims`: The number of grid points in each dimension.
- `stagger`: The location of the variable relative to its associated mesh.
The mesh associated with a variable is always node-centred, i.e. the values written as
mesh data specify the nodal values of a grid. Variables may be defined at points
which are offset from this grid due to grid staggering in the code.
The `stagger` entry specifies where the variable is defined relative to the mesh.
Since we have already defined the number of points that the associated mesh contains,
this determines how many points are required to display the variable.
The `stagger` entry can take one of the following values
- `CellCentre`: Cell centred. At the midpoint between nodes. Implies an
``(nx; ny; nz)`` grid.
- `FaceX`: Face centred in X. Located at the midpoint between nodes on
the Y-Z plane. Implies an ``(nx + 1; ny; nz)`` grid.
- `FaceY`: Face centred in Y. Located at the midpoint between nodes on
the X-Z plane. Implies an ``(nx; ny + 1; nz)`` grid.
- `FaceZ`: Face centred in Z. Located at the midpoint between nodes on
the X-Y plane. Implies an ``(nx; ny; nz + 1)`` grid.
- `EdgeX`: Edge centred along X. Located at the midpoint between nodes
along the X-axis. Implies an ``(nx; ny + 1; nz + 1)`` grid.
- `EdgeY`: Edge centred along Y. Located at the midpoint between nodes
along the Y-axis. Implies an ``(nx + 1; ny; nz + 1)`` grid.
- `EdgeZ`: Edge centred along Z. Located at the midpoint between nodes
along the Z-axis. Implies an ``(nx + 1; ny + 1; nz)`` grid.
- `Vertex`: Node centred. At the same place as the mesh. Implies an ``(nx+
1; ny + 1; nz + 1)`` grid.
For a grid based variable, the data written contains the values of
the given variable at each point on the mesh.
This is in the form of a 1d, 2d or 3d array depending on the dimensions
of the simulation. The size of the array depends on the size of
the associated mesh and the grid staggering as indicated above. It
corresponds to the values written into the `dims` array written for
this block.
"""
struct PlainVariableBlockHeader{T,N} <: AbstractBlockHeader{T,N}
base_header::BlockHeader{T,N}
mult::Float64
units::String
mesh_id::String
dims::NTuple{N,Int32}
stagger::Stagger
end
Base.size(block::PlainVariableBlockHeader) = block.dims
Base.size(block::PlainVariableBlockHeader, i::Int) = block.dims[i]
@doc """
PointVariableBlockHeader{T,N}
The `PointVariableBlockHeader` is used to describe a variable which is
located relative to the points given in a mesh block.
The block header contains the `base_header` (a `BlockHeader`) and the following metadata
- `mult`: The normalisation factor applied to the variable data.
- `units`: The units for this variable after the normalisation factor has
been applied.
- `mesh_id`: The name(`id`) of the mesh relative to which this block's data is defined.
- `np`: The number of points.
Similarly to the grid based variable, the data written contains the values
of the given variable at each point on the mesh. Since each the location of
each point in space is known fully, there is no need for a stagger variable.
The data is in the form of a 1d array with `np` elements.
"""
struct PointVariableBlockHeader{T,N} <: AbstractBlockHeader{T,N}
base_header::BlockHeader{T,N}
mult::Float64
units::String
mesh_id::String
np::Int64
end
Base.size(block::PointVariableBlockHeader) = (block.np,)
struct RunInfoBlockHeader{T,N} <: AbstractBlockHeader{T,N}
base_header::BlockHeader{T,N}
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 466 | function get_units(unit_str)
isempty(unit_str) && return 1
# workaround for number density units
unit_str == "#" && return 1
# workaround stuff like kg.m/s
unit_str = replace(unit_str, "."=>"*")
# workaround stuff like 1/m^3
if occursin(r"1\/([a-z]*\^[0-9]?)", unit_str)
unit_str = replace(unit_str, r"1\/([a-z]*)\^([0-9]?)" => s"\g<1>^-\g<2>")
end
uparse(unit_str)
end
get_units(unit_str::NTuple) = get_units.(unit_str)
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 1231 | function get_normalization(block::T) where {T}
hasproperty(block, :mult) ? block.mult : block.mults
end
Base.nameof(block::AbstractBlockHeader) = nameof(block.base_header)
labels(block::PointMeshBlockHeader) = block.labels
labels(block::PlainMeshBlockHeader) = block.labels
get_offset(block::AbstractBlockHeader) = block.base_header.data_location
get_offset(block::PointMeshBlockHeader{T}, axis::Int) where {T} = get_offset(block) + sizeof(T) * block.np * (axis - 1)
get_offset(block::PlainMeshBlockHeader{T}, axis::Int) where {T} = get_offset(block) + sizeof(T) * block.dims[axis] * (axis - 1)
function add_units(raw_data::NTuple, block)
𝟙 = one(eltype(block))
T = typeof(𝟙 * get_units(block.units)[1])
map(data -> reinterpret(T, data), raw_data)
end
function add_units(raw_data, block)
𝟙 = one(eltype(block))
reinterpret(typeof(𝟙 * get_units(block.units)), raw_data)
end
function apply_normalization!(raw_data, block)
𝟙 = one(eltype(block))
n = get_normalization(block)
if n isa Number
default_factor = 𝟙
else
default_factor = ntuple(one, ndims(block))
end
if n ≠ default_factor
raw_data .*= get_normalization(block)
end
return nothing
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 1653 | using SDFReader
using Serialization
using DiskArrays: haschunks, Chunked
using Test
fn = joinpath(@__DIR__, "0002.sdf")
ref_fn = joinpath(@__DIR__, "0002.jls")
v_header, data, grids, units = open(deserialize, ref_fn)
blocks = file_summary(fn)
unsupported = ["cpu/proton", "cpu/electron", "run_info", "cpu_rank", "elapsed_time"]
meshes = ["grid", "grid/electron", "grid/proton"]
variables = setdiff(keys(blocks), unsupported, meshes)
@testset "DiskArrayVariable" begin
open(fn, "r") do f
@testset "$key" for key in variables
block = blocks[key]
sda = DiskArrayVariable(f, block)
data = read!(f, block)
@test haschunks(sda) isa Chunked
@test sda[1, 1, 1] == data[1, 1, 1]
@test sda[2, 1, 1] == data[2, 1, 1]
@test sda[1:10, 1, 1] == data[1:10, 1, 1]
@test sda[15:20] == data[15:20]
@test sda[:, 1, 1] == data[:, 1, 1]
@test sda[:] == vec(data)
end
end
end
@testset "DiskArrayMesh" begin
open(fn, "r") do f
@testset "$key" for key in meshes
block = blocks[key]
@testset "$key with axis $axis" for axis in 1:3
sda = DiskArrayMesh(f, block, axis)
data = read!(f, block)[axis]
@test haschunks(sda) isa Chunked
@test sda[1] == data[1]
@test sda[2:3] == data[2:3]
@test sda[1:5] == data[1:5]
@test sda[5:end] == data[5:end]
@test sda[begin:end] == data[begin:end]
@test sda[:] == data[:]
end
end
end
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 246 | using .SDF
using Test
file_name = "0002.sdf"
bloks = fetch_blocks(file_name)
f = open(file_name)
ar1=read!(f, bloks[4])
ar4, idx4=Main.SDF.read2(f, bloks[4]; req_pts=((1, 3), (2, 6), (3, 6)), fn=x->x>0)
close(f)
@test ar4 == ar1[idx4]
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 1524 | using SDFReader
using Serialization
using Test
fn = joinpath(@__DIR__, "0002.sdf")
ref_fn = joinpath(@__DIR__, "0002.jls")
v_header, data, grids, units = open(deserialize, ref_fn)
blocks = file_summary(fn)
unsupported = ["cpu/proton", "cpu/electron", "run_info", "cpu_rank", "elapsed_time", "grid"]
meshes = ["grid/electron", "grid/proton"]
variables = setdiff(keys(blocks), unsupported, meshes)
@testset "MmapedVariable" begin
open(fn, "r") do f
@testset "$key" for key in variables
block = blocks[key]
sda = MmapedVariable(f, block)
data = read!(f, block)
@test sda[1, 1, 1] == data[1, 1, 1]
@test sda[2, 1, 1] == data[2, 1, 1]
@test sda[1:10, 1, 1] == data[1:10, 1, 1]
@test sda[15:20] == data[15:20]
@test sda[:, 1, 1] == data[:, 1, 1]
@test sda[:] == vec(data)
end
end
end
@testset "MmapedParticleMesh" begin
open(fn, "r") do f
@testset "$key" for key in meshes
block = blocks[key]
@testset "$key with axis $axis" for axis in 1:3
sda = MmapedParticleMesh(f, block, axis)
data = read!(f, block)[axis]
@test sda[1] == data[1]
@test sda[2:3] == data[2:3]
@test sda[1:5] == data[1:5]
@test sda[5:end] == data[5:end]
@test sda[begin:end] == data[begin:end]
@test sda[:] == data[:]
end
end
end
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 383 | using SDFReader
using Test
using Aqua
@testset "Aqua" begin Aqua.test_all(SDFReader,
ambiguities = (recursive = false)) end
# no non-const globals
non_const_names = filter(x->!isconst(SDFReader, x), names(SDFReader, all = true))
# filter out gensymed names
filter!(x->!startswith(string(x), "#"), non_const_names)
@test isempty(non_const_names)
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 312 | using Test
using SafeTestsets
@testset "SDFReader.jl" begin
@safetestset "SDF header" begin include("sdf_header.jl") end
@safetestset "SDF data" begin include("sdf.jl") end
@safetestset "DiskArrays integration" begin include("chunks.jl") end
@safetestset "mmap" begin include("mmap.jl") end
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 1906 | using SDFReader
using Serialization
using LRUCache
using Test
fn = joinpath(@__DIR__, "0002.sdf")
ref_fn = joinpath(@__DIR__, "0002.jls")
v_header, data, grids, units = open(deserialize, ref_fn)
@testset "SDF" begin
blocks = file_summary(fn)
@testset "Units" begin
for (key, block) in pairs(blocks)
if hasfield(typeof(block), :units)
@test block.units == units[string(key)]
end
end
end
unsupported = ["cpu/proton", "cpu/electron", "run_info", "cpu_rank"]
@testset "Data" begin
open(fn, "r") do f
@testset "$key" for (key, block) in pairs(blocks)
if key ∉ unsupported
@test read!(f, block) == data[string(key)]
end
end
end
end
@testset "Utilities" begin
@test nameof(blocks["ex"]) == "Electric Field/Ex"
@test labels(blocks["grid"]) == ("X", "Y", "Z")
@test labels(blocks["grid/electron"]) == ("X", "Y", "Z")
end
@testset "Cache" begin
cache = LRU{Tuple{String,AbstractBlockHeader},AbstractArray}(maxsize=2)
open(fn, "r") do f
t1 = 0.
t2 = 0.
@testset "store" begin
ex = @timed cached_read(f, blocks["ex"], cache)
@test read(f, blocks["ex"]) == ex.value
t1 = ex.time
@test read(f, blocks["ey"]) == cached_read(f, blocks["ey"], cache)
end
@testset "load" begin
ex = @timed cached_read(f, blocks["ex"], cache)
@test read(f, blocks["ex"]) == ex.value
@test read(f, blocks["ey"]) == cached_read(f, blocks["ey"], cache)
t2 = ex.time
# test that the cache was used
@test t2 < 100t1
@test length(cache) == 2
end
end
end
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 489 | using SDFReader
using Serialization
using Test
fn = joinpath(@__DIR__, "0002.sdf")
ref_fn = joinpath(@__DIR__, "0002.jls")
v_header, data, grids, units = open(deserialize, ref_fn)
h = header(fn)
saved_props = setdiff(propertynames(h),
[:sdf_magic, :endianness, :summary_location, :summary_size,
:first_block_location, :nblocks, :block_header_length,
:string_length])
@testset "$p" for p in saved_props
@test getproperty(h, p) == getindex(v_header, string(p))
end
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | code | 2467 | module VerificationData
export create_dicts
using PyCall
using Serialization
const sdf = PyNULL()
const sh = PyNULL()
function __init__()
copy!(sdf, pyimport("sdf"))
copy!(sh, pyimport("sdf_helper"))
end
function convert_it(read_only_numpy_arr::PyObject)
# See https://github.com/JuliaPy/PyCall.jl/blob/master/src/pyarray.jl#L14-L24
# instead of PyBUF_ND_STRIDED = Cint(PyBUF_WRITABLE | PyBUF_FORMAT | PyBUF_ND | PyBUF_STRIDES)
# See https://github.com/JuliaPy/PyCall.jl/blob/master/src/pybuffer.jl#L113
pybuf = PyBuffer(read_only_numpy_arr, PyCall.PyBUF_FORMAT | PyCall.PyBUF_ND | PyCall.PyBUF_STRIDES)
T, native_byteorder = PyCall.array_format(pybuf)
sz = size(pybuf)
strd = PyCall.strides(pybuf)
length(strd) == 0 && (sz = ())
N = length(sz)
isreadonly = pybuf.buf.readonly==1
info = PyCall.PyArray_Info{T,N}(native_byteorder, sz, strd, pybuf.buf.buf, isreadonly, pybuf)
# See https://github.com/JuliaPy/PyCall.jl/blob/master/src/pyarray.jl#L123-L126
PyCall.PyArray{T,N}(read_only_numpy_arr, info)
end
function filereader(path; convert=false)
sdf.read(path, convert=convert)
end
convert_variable(py_data::Tuple) = Array.(convert_it.(py_data))
convert_variable(py_data::PyObject) = Array(convert_it(py_data))
convert_variable(py_data) = py_data
function get_grid(py_obj, data_size)
grid = convert_it.(py_obj.grid.data)
if data_size[1] == length.(grid)[1]
return Array.(grid)
else
grid_mid = Array.(convert_it.(py_obj.grid_mid.data))
return grid_mid
end
end
function create_dicts(fn)
fr = filereader(fn)
header = fr.Header
variables = filter!(k->!startswith(k, "__"), String.(keys(fr)))
filter!(k->k≠"Header", variables)
data = Dict{String, Any}()
grids = Dict{String, NTuple{3,Vector}}()
units = Dict{String, Union{String,Tuple{String},NTuple{3,String}}}()
for v in variables
sdf_var = getproperty(fr, v)
id = sdf_var.id
if hasproperty(sdf_var, :data)
data[id] = convert_variable(sdf_var.data)
if hasproperty(sdf_var, :grid)
grids[id] = get_grid(sdf_var, size(data[id]))
end
end
if hasproperty(sdf_var, :units)
units[id] = sdf_var.units
end
end
return header, data, grids, units
end
function create_dicts()
serialize("0002.jl", create_dicts("0002.sdf"))
end
end # module VerificationData
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | docs | 1769 | # SDFReader
[](https://SebastianM-C.github.io/SDFReader.jl/stable)
[](https://SebastianM-C.github.io/SDFReader.jl/dev)
[](https://github.com/SebastianM-C/SDFReader.jl/actions)

[EPOCH](https://cfsa-pmw.warwick.ac.uk/mediawiki/index.php/EPOCH:FAQ) is a code for plasma physics simulations using the Particle-in-Cell method. The simulation results are written is `.sdf` binary files. Several readers for this files are available at https://cfsa-pmw.warwick.ac.uk/SDF.
This package intends to be another reader for the `.sdf` file type providing low level acces to the data by following the [SDF file format documentation](https://cfsa-pmw.warwick.ac.uk/SDF/SDF_documentation).
For a more user firendly approach, please use [SDFResults](https://github.com/SebastianM-C/SDFResults.jl).
## Quick start
Install the package using
```
]add SDFReader
```
The metadata in the `.sdf` files can be accessed with the `file_summary` function
```julia
blocks = file_summary(filename)
```
This will return a dictionary that can be used to access the block headers corrsoponding to the data.
To read the data use
```julia
ex = open(file) do f
read(f, blocks[:ex])
end
```
For more information regarding the information contained in the `.sdf` files,
please consult the following
* [EPOCH documentation](https://cfsa-pmw.warwick.ac.uk/mediawiki/index.php/EPOCH:Landing_Page)
* [SDF file format documentation](https://cfsa-pmw.warwick.ac.uk/SDF/SDF_documentation)
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT",
"BSD-3-Clause"
] | 0.5.1 | 4a50779ff74aef963a68670cd9214615ae10bc62 | docs | 70 | # SDFReader.jl
```@index
```
```@autodocs
Modules = [SDFReader]
```
| SDFReader | https://github.com/SebastianM-C/SDFReader.jl.git |
|
[
"MIT"
] | 0.5.5 | dadb7a429d8c2389a0db83ebbfc00121414d1e7f | code | 8791 | module Gemini
using WebSockets: HTTP, open, isopen, writeguarded, readguarded
using JSON
using Dates
using Base64
using Nettle
using StringEncodings
struct GeminiResponse
status
response
end
"""
Open a Websocket client to the v2/marketdata endpoint
https://docs.gemini.com/websocket-api/#market-data-version-2
# Arguments:
- `sandbox::Bool`: Sandbox request
- `channel::Channel{Dict}`: channel to pass data
- `names::Vector`: data feed name subscriptions (l2, candles_1m,...)
- `symbols::Vector`: symbol subscriptions (BTCUSD,...)
"""
function marketdata_v2(sandbox::Bool, channel::Channel{Dict}, names::Vector, symbols::Vector)::GeminiResponse
if >(length(names), 0) && >(length(symbols), 0)
if sandbox
base_url = "ws://api.sandbox.gemini.com"
else
base_url = "ws://api.gemini.com"
end
msg = Dict(
"type" => "subscribe",
"subscriptions" => []
)
for name in names
push!(
msg["subscriptions"],
Dict(
"name" => name,
"symbols" => symbols
)
)
end
open(base_url*"/v2/marketdata") do ws
if isopen(ws)
if writeguarded(ws, JSON.json(msg))
while isopen(ws)
data, success = readguarded(ws)
if success
put!(channel, JSON.parse(String(data))::Dict)
end
end
else
return GeminiResponse(false, Dict("error"=>"failed to send subscription information to Gemini"))
end
else
return GeminiResponse(false, Dict("error"=>"failed to open websocket"))
end
end
else
return GeminiResponse(false, Dict("error"=>"no subscriptions given"))
end
end
"""
Creates a new order
https://docs.gemini.com/rest-api/#new-order
# Arguments:
- `sandbox::Bool`: Sandbox request
- `api_key::String`: Gemini API key
- `api_secret::String`: Gemini API secret
- `side::String`: "buy" or "sell"
- `symbol::String`: The symbol for the new order
- `amount::String`: Quoted decimal amount to purchase
- `price::String`: Quoted decimal amount to spend per unit
- `type::String`: The order type. "exchange limit" for all order types except for stop-limit orders. "exchange stop limit" for stop-limit orders.
- `options::Vector{String}`: Optional. An optional array containing at most one supported order execution option.
- `stop_price::String`: Optional. The price to trigger a stop-limit order. Only available for stop-limit orders.
"""
function new_order(sandbox::Bool, api_key::String, api_secret::String, side::String, symbol::String, amount::String, price::String, type::String, options::Vector{String}=Vector{String,1}(), stop_price::String="")
if sandbox
url = "https://api.sandbox.gemini.com/v1/order/new"
else
url = "https://api.gemini.com/v1/order/new"
end
payload = Dict(
"request" => "/v1/order/new",
"nonce" => string(Dates.datetime2epochms(Dates.now())),
"symbol" => symbol,
"amount" => amount,
"price" => price,
"side" => side,
"type" => type,
"options" => options,
"stop_price" => stop_price
)
encoded_payload = encode(JSON.json(payload), "UTF-8")
b64 = base64encode(encoded_payload)
signature = hexdigest("SHA384", encode(api_secret, "UTF-8"), b64)
request_headers = Dict(
"Content-Type" => "text/plain",
"Content-Length" => "0",
"X-GEMINI-APIKEY" => api_key,
"X-GEMINI-PAYLOAD" => b64,
"X-GEMINI-SIGNATURE" => signature,
"Cache-Control" => "no-cache"
)
try
response = HTTP.request(
"POST",
url,
request_headers;
retry = false
)
return GeminiResponse(response.status, JSON.parse(String(response.body)))
catch err
if isa(err, HTTP.ExceptionRequest.StatusError)
if ==(err.status, 503)
return GeminiResponse(err.status, JSON.parse(String(err.response.body)))
else
return GeminiResponse(err.status, err.response.body)
end
end
end
end
"""
Cancels an open order
https://docs.gemini.com/rest-api/#cancel-order
# Arguments:
- `sandbox::Bool`: Sandbox request
- `api_key::String`: Gemini API key
- `api_secret::String`: Gemini API secret
- `order_id::Int64`: Order id to cancel, given by new_order()
"""
function cancel_order(sandbox::Bool, api_key::String, api_secret::String, order_id::Int64)
if sandbox
url = "https://api.sandbox.gemini.com/v1/order/cancel"
else
url = "https://api.gemini.com/v1/order/cancel"
end
payload = Dict(
"request" => "/v1/order/cancel",
"nonce" => string(Dates.datetime2epochms(Dates.now())),
"order_id" => order_id,
)
encoded_payload = encode(JSON.json(payload), "UTF-8")
b64 = base64encode(encoded_payload)
signature = hexdigest("SHA384", encode(api_secret, "UTF-8"), b64)
request_headers = Dict(
"Content-Type" => "text/plain",
"Content-Length" => "0",
"X-GEMINI-APIKEY" => api_key,
"X-GEMINI-PAYLOAD" => b64,
"X-GEMINI-SIGNATURE" => signature,
"Cache-Control" => "no-cache"
)
try
response = HTTP.request(
"POST",
url,
request_headers;
retry = false
)
return GeminiResponse(response.status, JSON.parse(String(response.body)))
catch err
if isa(err, HTTP.ExceptionRequest.StatusError)
if ==(err.status, 503)
return GeminiResponse(err.status, JSON.parse(String(err.response.body)))
else
return GeminiResponse(err.status, err.response.body)
end
end
end
end
"""
This endpoint retrieves all available symbols for trading
https://docs.gemini.com/rest-api/#symbols
# Arguments:
- `sandbox::Bool`: Sandbox request
"""
function symbols(sandbox::Bool)
if sandbox
url = "https://api.sandbox.gemini.com/v1/symbols"
else
url = "https://api.gemini.com/v1/symbols"
end
try
response = HTTP.request("GET", url)
return GeminiResponse(response.status, JSON.parse(String(response.body)))
catch err
if isa(err, HTTP.ExceptionRequest.StatusError)
if ==(err.status, 503)
return GeminiResponse(err.status, JSON.parse(String(err.response.body)))
else
return GeminiResponse(err.status, err.response.body)
end
end
end
end
"""
This endpoint retrieves extra detail on supported symbols, such as minimum order size, tick size, quote increment and more.
https://docs.gemini.com/rest-api/#symbol-details
# Arguments:
- `sandbox::Bool`: Sandbox request
- `symbol::String`: Trading pair symbol
"""
function symbol_details(sandbox::Bool, symbol::String)
if sandbox
url = "https://api.sandbox.gemini.com/v1/symbols/details/"
else
url = "https://api.gemini.com/v1/symbols/details/"
end
try
response = HTTP.request("GET", url*symbol)
return GeminiResponse(response.status, JSON.parse(String(response.body)))
catch err
if isa(err, HTTP.ExceptionRequest.StatusError)
if ==(err.status, 503)
return GeminiResponse(err.status, JSON.parse(String(err.response.body)))
else
return GeminiResponse(err.status, err.response.body)
end
end
end
end
"""
Order events is a private API that gives you information about your orders in real time.
https://docs.gemini.com/websocket-api/#order-events
# Arguments:
- `sandbox::Bool`: Sandbox request
- `channel::Channel{Dict}`: channel to pass data
- `names::Vector`: data feed name subscriptions (l2, candles_1m,...)
- `symbols::Vector`: symbol subscriptions (BTCUSD,...)
"""
#=
function order_events(sandbox::Bool, api_key::String, api_secret::String, channel::Channel{Dict})::GeminiResponse
if sandbox
base_url = "wss://api.sandbox.gemini.com"
else
base_url = "wss://api.gemini.com"
end
payload = Dict(
"request" => "/v1/order/events",
"nonce" => string(Dates.datetime2epochms(Dates.now()))
)
encoded_payload = encode(JSON.json(payload), "UTF-8")
b64 = base64encode(encoded_payload)
signature = hexdigest("SHA384", encode(api_secret, "UTF-8"), b64)
request_headers = Dict(
"Content-Type" => "text/plain",
"Content-Length" => "0",
"X-GEMINI-APIKEY" => api_key,
"X-GEMINI-PAYLOAD" => b64,
"X-GEMINI-SIGNATURE" => signature,
"Cache-Control" => "no-cache"
)
HTTP.WebSockets.open(base_url*"/v1/order/events") do ws
if isopen(ws)
if writeguarded(ws, JSON.json(msg))
while isopen(ws)
data, success = readguarded(ws)
if success
put!(channel, JSON.parse(String(data))::Dict)
end
end
else
return GeminiResponse(false, Dict("error"=>"failed to send subscription information to Gemini"))
end
else
return GeminiResponse(false, Dict("error"=>"failed to open websocket"))
end
end
end
=#
export GeminiResponse
export marketdata_v2
export new_order
export cancel_order
export symbols
export symbol_details
end # module
| Gemini | https://github.com/rory-linehan/Gemini.jl.git |
|
[
"MIT"
] | 0.5.5 | dadb7a429d8c2389a0db83ebbfc00121414d1e7f | code | 301 | @testset "marketdata_v2" begin
channel = Channel{Dict}(5)
println("opening socket to Gemini v2/marketdata...")
@async marketdata_v2(
false,
channel,
["candles_1m"],
["BTCUSD"]
)
for _ in 1:5
data = take!(channel)
println("received data...")
end
close(channel)
end | Gemini | https://github.com/rory-linehan/Gemini.jl.git |
|
[
"MIT"
] | 0.5.5 | dadb7a429d8c2389a0db83ebbfc00121414d1e7f | code | 582 | @testset "orders" begin
r = new_order(
true,
ENV["GEMINI_API_KEY"],
ENV["GEMINI_API_SECRET"],
"buy",
"btcusd",
"1",
"49000.00",
"exchange limit",
["fill-or-kill"]
)
println(r)
if ==(r.status, 200)
if ==(r.response["is_cancelled"], false)
order_id = parse(Int64, r.response["order_id"])
r = cancel_order(
true,
ENV["GEMINI_API_KEY"],
ENV["GEMINI_API_SECRET"],
order_id
)
println(r)
if !=(r.status, 200)
@test false
end
end
else
@test false
end
end | Gemini | https://github.com/rory-linehan/Gemini.jl.git |
|
[
"MIT"
] | 0.5.5 | dadb7a429d8c2389a0db83ebbfc00121414d1e7f | code | 492 | using Gemini
using Test
@testset "Gemini.jl" begin
printstyled(color=:blue, "marketdata_v2\n")
@testset "marketdata_v2" begin
include("marketdata_v2.jl");sleep(1)
end
printstyled(color=:blue, "symbols\n")
@testset "symbols" begin
include("symbols.jl");sleep(1)
end
# manual testing for now, until I can mock up an HTTP server to return dummy requests.
# printstyled(color=:blue, "orders\n")
# @testset "orders" begin
# include("orders.jl");sleep(1)
# end
end
| Gemini | https://github.com/rory-linehan/Gemini.jl.git |
|
[
"MIT"
] | 0.5.5 | dadb7a429d8c2389a0db83ebbfc00121414d1e7f | code | 180 | @testset "symbols" begin
r = symbols(false)
println(r)
r.response::Vector{Any}
r = symbol_details(false, r.response[begin])
println(r)
r.response::Dict{String, Any}
end | Gemini | https://github.com/rory-linehan/Gemini.jl.git |
|
[
"MIT"
] | 0.5.5 | dadb7a429d8c2389a0db83ebbfc00121414d1e7f | docs | 938 | ### 0.5.5
* remove Manifest.toml from git tracking
### 0.5.4
* update package manifest compats
* fix HTTP/WebSockets namespace issue
### 0.5.3
* added GitHub Actions workflow for running tests and parameterizing secrets
### 0.5.2
* update Manifest.toml format
### 0.5.1
* fixing/improving tests
### 0.5.0
* more error handling improvement, standardizing return interface
### 0.4.2
* converting get/post to request
### 0.4.1
* improved error handling for REST calls
### 0.4.0
* adding symbols()
* adding symbol_details()
### 0.3.1
* turning off default retry
### 0.3.0
* adding order_events() placeholder
* fixing options parameter type for new_order to Vector{String}
### 0.2.0
* adding new_order()
* adding cancel_order()
* adding sandbox to marketdatav2()
* adding CONTRIBUTING.md
### 0.1.1
* fixing indentation
### 0.1.0
* initial release
* removed old versioning due to figuring out JuliaRegistry's workings | Gemini | https://github.com/rory-linehan/Gemini.jl.git |
|
[
"MIT"
] | 0.5.5 | dadb7a429d8c2389a0db83ebbfc00121414d1e7f | docs | 153 | ## Contributing
All contributions are welcome, just open a PR and let's talk!
As this project matures, I'll come up with interface and style guidelines. | Gemini | https://github.com/rory-linehan/Gemini.jl.git |
|
[
"MIT"
] | 0.5.5 | dadb7a429d8c2389a0db83ebbfc00121414d1e7f | docs | 396 | # Gemini API wrapper for Julia
## Overview
Provides a wrapper to the Gemini API with native Julia types, taking care of the heavy lifting for integrating your application.
## Usage
`pkg> add Gemini`
See tests for example usage.
## Implementation Notes
* Master API keys are not supported at this time, make sure you use a Primary key.
This also means that subaccounts are not supported.
| Gemini | https://github.com/rory-linehan/Gemini.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 771 | using Documenter, AWSClusterManagers
makedocs(;
modules = [AWSClusterManagers],
authors = "Invenia Technical Computing Corporation",
repo = "https://github.com/JuliaCloud/AWSClusterManagers.jl/blob/{commit}{path}#L{line}",
sitename = "AWSClusterManagers.jl",
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true",
),
pages = [
"Home" => "index.md",
"Docker" => "pages/docker.md",
"Batch" => "pages/batch.md",
"ECS" => "pages/ecs.md",
"Design" => "pages/design.md",
"API" => "pages/api.md",
],
strict = true,
checkdocs = :exports,
)
deploydocs(;
repo = "github.com/JuliaCloud/AWSClusterManagers.jl",
devbranch = "main",
push_preview = true,
)
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 790 | module AWSClusterManagers
using AWSBatch: JobQueue, max_vcpus, run_batch
using Dates: Dates, Period, Minute, Second, Millisecond
using Distributed: Distributed, ClusterManager, WorkerConfig, cluster_cookie, start_worker
using JSON: JSON
using Memento: Memento, getlogger, warn, notice, info, debug
using Mocking: Mocking, @mock
using Sockets: IPAddr, IPv4, @ip_str, accept, connect, getipaddr, listen, listenany
export AWSBatchManager, AWSBatchNodeManager, DockerManager, start_batch_node_worker
const LOGGER = getlogger(@__MODULE__)
function __init__()
# https://invenia.github.io/Memento.jl/latest/faq/pkg-usage/
return Memento.register(LOGGER)
end
include("socket.jl")
include("container.jl")
include("batch.jl")
include("batch_node.jl")
include("docker.jl")
end # module
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 6860 | # Time to wait for the AWS Batch cluster to scale up, spot requests to be fufilled,
# instances to finish initializing, and have the worker instances connect to the manager.
# Note that when using 3 workers, it is not uncommon for the third worker to take 15 - 21
# minutes longer than the other 2 workers to start up
const BATCH_TIMEOUT = Minute(25)
# Note: Communication directly between AWS Batch jobs works since the underlying ECS task
# implicitly uses networkMode: host. If this changes to another networking mode AWS Batch
# jobs may no longer be able to listen to incoming connections.
"""
AWSBatchManager(max_workers; kwargs...)
AWSBatchManager(min_workers:max_workers; kwargs...)
AWSBatchManager(min_workers, max_workers; kwargs...)
A cluster manager which spawns workers via [Amazon Web Services Batch](https://aws.amazon.com/batch/)
service. Typically used within an AWS Batch job to add additional resources. The number of
workers spawned may be potentially be lower than the requested `max_workers` due to resource
contention. Specifying `min_workers` can allow the launch to succeed with less than the
requested `max_workers`.
## Arguments
- `min_workers::Int`: The minimum number of workers to spawn or an exception is thrown
- `max_workers::Int`: The number of requested workers to spawn
## Keywords
- `definition::AbstractString`: Name of the AWS Batch job definition which dictates
properties of the job including the Docker image, IAM role, and command to run
- `name::AbstractString`: Name of the job inside of AWS Batch
- `queue::AbstractString`: The job queue in which workers are submitted. Can be either the
queue name or the Amazon Resource Name (ARN) of the queue. If not set will default to
the environmental variable "WORKER_JOB_QUEUE".
- `memory::Integer`: Memory limit (in MiB) for the job container. The container will be killed
if it exceeds this value.
- `region::AbstractString`: The region in which the API requests are sent and in which new
worker are spawned. Defaults to "us-east-1". [Available regions for AWS batch](http://docs.aws.amazon.com/general/latest/gr/rande.html#batch_region)
can be found in the AWS documentation.
- `timeout::Period`: The maximum number of seconds to wait for workers to become available
before attempting to proceed without the missing workers.
## Examples
```julia
julia> addprocs(AWSBatchManager(3)) # Needs to be run from within a running AWS batch job
```
"""
AWSBatchManager
struct AWSBatchManager <: ContainerManager
min_workers::Int
max_workers::Int
job_definition::AbstractString
job_name::AbstractString
job_queue::AbstractString
job_memory::Integer
region::AbstractString
timeout::Second
min_ip::IPv4
max_ip::IPv4
function AWSBatchManager(
min_workers::Integer,
max_workers::Integer,
definition::AbstractString,
name::AbstractString,
queue::AbstractString,
memory::Integer,
region::AbstractString,
timeout::Period=BATCH_TIMEOUT,
min_ip::IPv4=ip"0.0.0.0",
max_ip::IPv4=ip"255.255.255.255",
)
min_workers >= 0 || throw(ArgumentError("min workers must be non-negative"))
min_workers <= max_workers ||
throw(ArgumentError("min workers exceeds max workers"))
# Default the queue to using the WORKER_JOB_QUEUE environmental variable.
if isempty(queue)
queue = get(ENV, "WORKER_JOB_QUEUE", "")
end
region = isempty(region) ? "us-east-1" : region
return new(
min_workers,
max_workers,
definition,
name,
queue,
memory,
region,
Second(timeout),
min_ip,
max_ip,
)
end
end
function AWSBatchManager(
min_workers::Integer,
max_workers::Integer;
definition::AbstractString="",
name::AbstractString="",
queue::AbstractString="",
memory::Integer=-1,
region::AbstractString="",
timeout::Period=BATCH_TIMEOUT,
min_ip::IPv4=ip"0.0.0.0",
max_ip::IPv4=ip"255.255.255.255",
)
return AWSBatchManager(
min_workers,
max_workers,
definition,
name,
queue,
memory,
region,
timeout,
min_ip,
max_ip,
)
end
function AWSBatchManager(workers::UnitRange{<:Integer}; kwargs...)
return AWSBatchManager(first(workers), last(workers); kwargs...)
end
function AWSBatchManager(workers::Integer; kwargs...)
return AWSBatchManager(workers, workers; kwargs...)
end
launch_timeout(mgr::AWSBatchManager) = mgr.timeout
desired_workers(mgr::AWSBatchManager) = mgr.min_workers, mgr.max_workers
function Base.:(==)(a::AWSBatchManager, b::AWSBatchManager)
return (
a.min_workers == b.min_workers &&
a.max_workers == b.max_workers &&
a.job_definition == b.job_definition &&
a.job_name == b.job_name &&
a.job_queue == b.job_queue &&
a.job_memory == b.job_memory &&
a.region == b.region &&
a.timeout == b.timeout &&
a.min_ip == b.min_ip &&
a.max_ip == b.max_ip
)
end
function spawn_containers(mgr::AWSBatchManager, override_cmd::Cmd)
min_workers, max_workers = desired_workers(mgr)
max_workers < 1 && return nothing
queue = @mock JobQueue(mgr.job_queue)
max_compute = @mock max_vcpus(queue)
if min_workers > max_compute
error(
string(
"Unable to launch the minimum number of workers ($min_workers) as the ",
"minimum exceeds the max VCPUs available ($max_compute).",
),
)
elseif max_workers > max_compute
# Note: In addition to warning the user about the VCPU cap we could also also reduce
# the number of worker we request. Unfortunately since we don't know how many jobs
# are currently running or how long they will take we'll leave `max_workers`
# untouched.
warn(
LOGGER,
string(
"Due to the max VCPU limit ($max_compute) most likely only a partial amount ",
"of the requested workers ($max_workers) will be spawned.",
),
)
end
# Since each batch worker can only use one cpu we override the vcpus to one.
job = @mock run_batch(;
name=mgr.job_name,
definition=mgr.job_definition,
queue=mgr.job_queue,
region=mgr.region,
vcpus=1,
memory=mgr.job_memory,
cmd=override_cmd,
num_jobs=max_workers,
allow_job_registration=false,
)
if max_workers > 1
notice(LOGGER, "Spawning array job: $(job.id) (n=$(mgr.max_workers))")
else
notice(LOGGER, "Spawning job: $(job.id)")
end
return nothing
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 8905 | # A random ephemeral port. The port should always be free due to AWS Batch multi-mode
# parallel jobs using "awsvpc" networking on containers
const AWS_BATCH_JOB_NODE_PORT = 49152
# The maximum amount of time to listen for worker connections. Note that the manager
# (main node) is started before the workers (other nodes) which allows the manager time to
# initialize before the workers attempt to connect. In a scenario in which a worker fails
# and never connects to the manager this timeout will allow the manager continue with the
# subset of workers which have already connected.
const AWS_BATCH_NODE_TIMEOUT = Minute(5)
# Julia cluster manager for AWS Batch multi-node parallel jobs
# https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html
struct AWSBatchNodeManager <: ContainerManager
num_workers::Int
timeout::Second # Duration to wait for workers to initially check-in with the manager
function AWSBatchNodeManager(; timeout::Period=AWS_BATCH_NODE_TIMEOUT)
if !haskey(ENV, "AWS_BATCH_JOB_ID") || !haskey(ENV, "AWS_BATCH_JOB_MAIN_NODE_INDEX")
error(
"Unable to use $AWSBatchNodeManager outside of a running AWS Batch multi-node parallel job",
)
end
info(LOGGER, "AWS Batch Job ID: $(ENV["AWS_BATCH_JOB_ID"])")
if ENV["AWS_BATCH_JOB_NODE_INDEX"] != ENV["AWS_BATCH_JOB_MAIN_NODE_INDEX"]
error("$AWSBatchNodeManager can only be used by the main node")
end
# Don't include the manager in the number of workers
num_workers = parse(Int, ENV["AWS_BATCH_JOB_NUM_NODES"]) - 1
return new(num_workers, Second(timeout))
end
end
function Distributed.launch(
manager::AWSBatchNodeManager, params::Dict, launched::Array, c::Condition
)
num_workers = manager.num_workers
connected_workers = 0
debug(LOGGER, "Awaiting connections")
# We cannot listen only to the `ENV["AWS_BATCH_JOB_MAIN_NODE_PRIVATE_IPV4_ADDRESS"]` as
# this variable is not available on the main node. However, since we known the workers
# will use this IPv4 specific address we'll only listen to IPv4 interfaces.
server = listen(IPv4(0), AWS_BATCH_JOB_NODE_PORT)
debug(LOGGER, "Manager accepting worker connections on port $AWS_BATCH_JOB_NODE_PORT")
# Maintain an internal array of worker configs to allow us to set the ordering
workers = sizehint!(WorkerConfig[], num_workers)
listen_task = @async while isopen(server) && connected_workers < num_workers
# TODO: Potential issue with a random connection consuming a worker slot?
sock = accept(server)
connected_workers += 1
# Receive the job id and node index from the connected worker
job_id = parse_job_id(readline(sock))
node_index = parse(Int, match(r"(?<=\#)\d+", job_id).match)
debug(LOGGER, "Worker connected from node $node_index")
# Send the cluster cookie and timeout to the worker
println(sock, "julia_cookie:", cluster_cookie())
println(sock, "julia_worker_timeout:", Dates.value(Second(manager.timeout)))
flush(sock)
# The worker will report it's own address through the socket. Eventually the
# built in Julia cluster manager code will parse the stream and record the
# address and port.
config = WorkerConfig()
config.io = sock
config.userdata = (; :job_id => job_id, :node_index => node_index)
push!(workers, config)
end
wait(listen_task, manager.timeout)
close(server)
# Note: `launched` is treated as a queue and will have elements removed from it
# periodically from `addprocs`. By adding all the elements at once we can control the
# ordering of the workers make it the same as the node index ordering.
#
# Note: Julia worker numbers will not match up to the node index of the worker.
# Primarily this is due to the worker numbers being 1-indexed while nodes are 0-indexed.
append!(launched, sort!(workers; by=w -> w.userdata.node_index))
notify(c)
if connected_workers < num_workers
warn(
LOGGER,
"Only $connected_workers of the $num_workers workers job have reported in",
)
else
debug(LOGGER, "All workers have successfully reported in")
end
end
function start_batch_node_worker()
if !haskey(ENV, "AWS_BATCH_JOB_ID") || !haskey(ENV, "AWS_BATCH_JOB_NODE_INDEX")
error(
"Unable to start a worker outside of a running AWS Batch multi-node parallel job",
)
end
info(LOGGER, "AWS Batch Job ID: $(ENV["AWS_BATCH_JOB_ID"])")
# Note: Limiting to IPv4 to match what AWS Batch provides us with for the manager.
function available_ipv4_msg()
io = IOBuffer()
write(io, "Available IPv4 interfaces are:")
# Include a listing of external IPv4 interfaces and addresses for debugging.
for i in get_interface_addrs()
if i.address isa IPv4 && !i.is_internal
write(io, "\n $(i.name): inet $(i.address)")
end
end
return String(take!(io))
end
# A multi-node parallel job uses the "awsvpc" networking mode which defines "ecs-eth0"
# in addition to the "eth0" interface. By default Julia tries to use the IP address from
# "ecs-eth0" which uses a local-link address (169.254.0.0/16) which is unreachable from
# the manager. Typically this is fixed by specifying the "eth0" IP address as
# `--bind-to` when starting the Julia worker process.
opts = Base.JLOptions()
ip = if opts.bindto != C_NULL
parse(IPAddr, unsafe_string(opts.bindto))
else
getipaddr()
end
if is_link_local(ip)
error(LOGGER) do
"Aborting due to use of link-local address ($ip) on worker which will be " *
"unreachable by the manager. Be sure to specify a `--bind-to` address when " *
"starting Julia. $(available_ipv4_msg())"
end
else
info(LOGGER, "Reporting worker address $ip to the manager")
debug(LOGGER) do
available_ipv4_msg()
end
end
# The environmental variable for the main node address is only set within multi-node
# parallel child nodes and is not present on the main node. See:
# https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html#mnp-env-vars
manager_ip = parse(IPv4, ENV["AWS_BATCH_JOB_MAIN_NODE_PRIVATE_IPV4_ADDRESS"])
# Establish a connection to the manager. If the manager is slow to startup the worker
# will attempt to connect for ~2 minutes.
manager_connect = retry(
() -> connect(manager_ip, AWS_BATCH_JOB_NODE_PORT);
delays=ExponentialBackOff(; n=8, max_delay=30),
check=(s, e) -> e isa Base.IOError,
)
sock = manager_connect()
# Note: The job ID also contains the node index
println(sock, "job_id:", ENV["AWS_BATCH_JOB_ID"])
flush(sock)
# Retrieve the cluster cookie from the manager
cookie = parse_cookie(readline(sock))
# Retrieve the worker timeout as specified in the manager
timeout = parse_worker_timeout(readline(sock))
# Hand off control to the Distributed stdlib which will have the worker report an IP
# address and port at which connections can be established to this worker.
#
# The worker timeout needs to be equal to or exceed the amount of time in which the
# manager waits for workers to report in. The reason for this is that the manager waits
# to connect to all workers until connecting to any worker. If we use the default
# timeout then a worker could report in early and self-terminate before the manager
# connects to that worker. If that scenario occurs then the manager will become stuck
# during the setup process.
withenv("JULIA_WORKER_TIMEOUT" => timeout) do
start_worker(sock, cookie)
end
end
function parse_job_id(str::AbstractString)
# Note: Require match on prefix to ensure we are parsing the correct value
m = match(r"^job_id:([a-z0-9-]{36}\#\d+)", str)
if m !== nothing
return m.captures[1]
else
error(LOGGER, "Unable to parse job id: $str")
end
end
function parse_cookie(str::AbstractString)
# Note: Require match on prefix to ensure we are parsing the correct value
m = match(r"^julia_cookie:(\w+)", str)
if m !== nothing
return m.captures[1]
else
error(LOGGER, "Unable to parse cluster cookie: $str")
end
end
function parse_worker_timeout(str::AbstractString)
# Note: Require match on prefix to ensure we are parsing the correct value
m = match(r"^julia_worker_timeout:(\d+)", str)
if m !== nothing
return parse(Int, m.captures[1])
else
error(LOGGER, "Unable to parse worker timeout: $str")
end
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 6074 | # Overview of how the ContainerManagers work:
#
# 1. Start a TCP server on the manager using a random port within the ephemeral range
# 2. Spawn additional jobs/tasks using definition overrides to spawn identical versions of
# Julia which will connect to the manager over TCP. The Julia function `start_worker` is
# run which sends the worker address and port to the manager via the TCP socket.
# 3. The manager receives all of the the workers addresses and stops the TCP server.
# 4. Using the reported addresses the manager connects to each of the worker like a typical
# cluster manager.
# Determine the start of the ephemeral port range on this system. Used in `listenany` calls.
const PORT_HINT = if Sys.islinux()
parse(Int, first(split(readchomp("/proc/sys/net/ipv4/ip_local_port_range"), '\t')))
elseif Sys.isapple()
parse(Int, readchomp(`sysctl -n net.inet.ip.portrange.first`))
else
49152 # IANA dynamic and/or private port range start (https://en.wikipedia.org/wiki/Ephemeral_port)
end
abstract type ContainerManager <: ClusterManager end
"""
launch_timeout(mgr::ContainerManager) -> Int
The maximum duration (in seconds) a manager will wait for a worker to connect since the
manager initiated the spawning of the worker.
"""
launch_timeout(::ContainerManager)
"""
desired_workers(mgr::ContainerManager) -> Tuple{Int, Int}
The minimum and maximum number of workers wanted by the manager.
"""
desired_workers(::ContainerManager)
function Distributed.launch(
manager::ContainerManager, params::Dict, launched::Array, c::Condition
)
min_workers, max_workers = desired_workers(manager)
num_workers = 0
# Determine the IP address of the current host within the specified range
ips = filter!(getipaddrs()) do ip
typeof(ip) === typeof(manager.min_ip) && manager.min_ip <= ip <= manager.max_ip
end
valid_ip = first(ips)
# Only listen to the single IP address which the workers attempt to connect to.
# TODO: Ideally should be using TLS connections.
port, server = listenany(valid_ip, PORT_HINT)
debug(LOGGER, "Manager accepting worker connections via: $valid_ip:$port")
listen_task = @async begin
while isopen(server) && num_workers < max_workers
# TODO: Potential issue with a random connection consuming a worker slot?
sock = accept(server)
num_workers += 1
# The worker will report it's own address through the socket. Eventually the
# built in Julia cluster manager code will parse the stream and record the
# address and port.
config = WorkerConfig()
config.io = sock
# Note: `launched` is treated as a queue and will have elements removed from it
# periodically.
push!(launched, config)
notify(c)
end
end
# Generate command which starts a Julia worker and reports its information back to the
# manager
#
# Typically Julia workers are started using the hidden `julia` flags `--bind-to` and
# `--worker`. We won't use the `--bind-to` flag as we do not know where the container
# will be started and what ports will be available. We don't want to use
# `--worker COOKIE` as this essentially runs `start_worker(STDOUT, COOKIE)` which
# reports the worker address and port to STDOUT. Instead we'll run the code ourselves
# and report the connection information back to the manager over a socket.
exec = """
using Distributed
using Sockets
sock = connect(ip\"$valid_ip\", $port)
start_worker(sock, \"$(cluster_cookie())\")
"""
override_cmd = `julia -e $exec`
# Non-blocking spawn of N-containers where N is equal to `max_workers`. Workers will
# report back to the manager via the open port we just opened.
spawn_containers(manager, override_cmd)
# Wait up to the timeout for workers to inform the manager of their address.
wait(listen_task, launch_timeout(manager))
# TODO: Does stopping listening terminate the sockets from `accept`? If so, we could
# potentially close the socket before we know the name of the connected worker. During
# prototyping this has not been an issue.
close(server) # Causes `listen_task` to complete
notify(c)
if num_workers < max_workers
if num_workers >= min_workers
warn(LOGGER, "Only managed to launch $num_workers/$max_workers workers")
else
error("Unable to launch the minimum number of workers")
end
end
end
function Distributed.manage(
manager::ContainerManager, id::Integer, config::WorkerConfig, op::Symbol
)
# Note: Terminating the TCP connection from the master to the worker will cause the
# worker to shutdown automatically.
end
# Waits for the `task` to complete. Stops waiting if duration waited exceeds the `timeout`.
function Base.wait(task::Task, timeout::Period)
timeout_secs = Dates.value(Second(timeout))
start = time()
while !istaskdone(task) && (time() - start) < timeout_secs
sleep(1)
end
end
# The Docker container ID can be determined from inside a container by inspecting
# /proc/self/cgroup. The container ID is always a 64-character hexadecimal string.
#
# https://github.com/aws/amazon-ecs-agent/issues/1119
# Note: For AWS Batch array jobs the "ecs/<job_id>" does not include the array index
# Note: GitHub Actions uses the prefix "actions_job"
const CGROUP_REGEX = r"\/(?:docker|ecs\/[0-9a-f]{32}|actions_job)\/(?<container_id>[0-9a-f]{64})\b"
# Determine the container ID of the currently running container
function container_id()
id = ""
isfile("/proc/self/cgroup") || return id
open("/proc/self/cgroup") do fp
while !eof(fp)
line = chomp(readline(fp))
value = split(line, ':')[3]
m = match(CGROUP_REGEX, value)
if m !== nothing
id = m[:container_id]
break
end
end
end
return String(id)
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 3208 | # Time to wait for the Docker containers to launch and the workers to connect to the
# manager
const DOCKER_TIMEOUT = Minute(1)
"""
DockerManager(num_workers; kwargs...)
A cluster manager which spawns workers via a locally running [Docker](https://docs.docker.com/)
daemon service. Typically used on a single machine to debug multi-machine Julia code.
In order to make a local Docker cluster you'll need to have an available Docker image that
has Julia, a version of AWSClusterManagers which includes DockerManager, and the docker
cli all baked into the image.
You can then create a Docker container which is capable of spawning additional Docker
containers via:
docker run --network=host -v /var/run/docker.sock:/var/run/docker.sock --rm -it <image> julia
**Note**: The host networking is required for the containers to be able to intercommunicate.
The Docker host's UNIX socket needs to be forwarded so we can allow the container to
communicate with host Docker process.
## Arguments
- `num_workers::Int`: The number of workers to spawn
## Keywords
- `image::AbstractString`: The docker image to run.
- `timeout::Second`: The maximum number of seconds to wait for workers to become available
before aborting.
## Examples
```julia
julia> addprocs(DockerManager(4, "myproject:latest"))
```
"""
DockerManager
struct DockerManager <: ContainerManager
num_workers::Int
image::AbstractString
timeout::Second
min_ip::IPv4
max_ip::IPv4
function DockerManager(
num_workers::Integer,
image::AbstractString,
timeout::Period=DOCKER_TIMEOUT,
min_ip::IPv4=ip"0.0.0.0",
max_ip::IPv4=ip"255.255.255.255",
)
num_workers >= 0 || throw(ArgumentError("num workers must be non-negative"))
# Workers by default inherit the defaults from the manager.
if isempty(image)
image = @mock image_id()
end
return new(num_workers, image, Second(timeout), min_ip, max_ip)
end
end
function DockerManager(
num_workers::Integer;
image::AbstractString="",
timeout::Union{Real,Period}=DOCKER_TIMEOUT,
min_ip::IPv4=ip"0.0.0.0",
max_ip::IPv4=ip"255.255.255.255",
)
return DockerManager(num_workers, image, timeout, min_ip, max_ip)
end
launch_timeout(mgr::DockerManager) = mgr.timeout
desired_workers(mgr::DockerManager) = mgr.num_workers, mgr.num_workers
function Base.:(==)(a::DockerManager, b::DockerManager)
return (a.num_workers == b.num_workers && a.image == b.image && a.timeout == b.timeout)
end
function spawn_containers(mgr::DockerManager, override_cmd::Cmd)
# Requires that the `docker` is installed
cmd = `docker run --detach --network=host --rm $(mgr.image)`
cmd = `$cmd $override_cmd`
# Docker only allow us to spawn a job at a time
for id in 1:(mgr.num_workers)
container_id = @mock read(cmd, String)
notice(LOGGER, "Spawning container: $container_id")
end
end
# Determine the image ID of the currently running container
function image_id(container_id::AbstractString=container_id())
json = JSON.parse(read(`docker container inspect $container_id`, String))
return last(split(json[1]["Image"], ':'))
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 3949 | using Sockets: IPAddr, IPv4, IPv6
# Copy of `Sockets._sizeof_uv_interface_address`
const _sizeof_uv_interface_address = ccall(:jl_uv_sizeof_interface_address, Int32, ())
# https://github.com/JuliaLang/julia/pull/30349
if VERSION < v"1.2.0-DEV.56"
using Base: uv_error
function getipaddrs()
addresses = IPv4[]
addr_ref = Ref{Ptr{UInt8}}(C_NULL)
count_ref = Ref{Int32}(1)
lo_present = false
err = ccall(
:jl_uv_interface_addresses,
Int32,
(Ref{Ptr{UInt8}}, Ref{Int32}),
addr_ref,
count_ref,
)
uv_error("getlocalip", err)
addr, count = addr_ref[], count_ref[]
for i in 0:(count - 1)
current_addr = addr + i * _sizeof_uv_interface_address
if 1 == ccall(
:jl_uv_interface_address_is_internal, Int32, (Ptr{UInt8},), current_addr
)
lo_present = true
continue
end
sockaddr = ccall(
:jl_uv_interface_address_sockaddr, Ptr{Cvoid}, (Ptr{UInt8},), current_addr
)
if ccall(:jl_sockaddr_in_is_ip4, Int32, (Ptr{Cvoid},), sockaddr) == 1
push!(
addresses,
IPv4(ntoh(ccall(:jl_sockaddr_host4, UInt32, (Ptr{Cvoid},), sockaddr))),
)
end
end
ccall(:uv_free_interface_addresses, Cvoid, (Ptr{UInt8}, Int32), addr, count)
return addresses
end
else
using Sockets: getipaddrs
end
"""
is_link_local(ip::IPv4) -> Bool
Determine if the IP address is within the [link-local address]
(https://en.wikipedia.org/wiki/Link-local_address) block 169.254.0.0/16.
"""
is_link_local(ip::IPv4) = ip"169.254.0.0" <= ip <= ip"169.254.255.255"
# Julia structure mirroring `uv_interface_address_t`
# http://docs.libuv.org/en/v1.x/misc.html#c.uv_interface_address_t
struct InterfaceAddress{T<:IPAddr}
name::String # Name of the network interface
is_internal::Bool # Interface is a loopback device
address::T
# netmask::T # No accessors available currently
end
# Julia commit 58bafe499b
const _jl_sockaddr_is_ip4, _jl_sockaddr_is_ip6 = let
prefix = VERSION >= v"1.3.0-DEV.434" ? :jl_sockaddr_is_ : :jl_sockaddr_in_is_
Symbol(prefix, :ip4), Symbol(prefix, :ip6)
end
# Based upon `getipaddrs` in "stdlib/Sockets/src/addrinfo.jl"
function get_interface_addrs()
addresses = InterfaceAddress[]
addr_ref = Ref{Ptr{UInt8}}(C_NULL)
count_ref = Ref{Int32}(1)
lo_present = false
err = ccall(
:jl_uv_interface_addresses,
Int32,
(Ref{Ptr{UInt8}}, Ref{Int32}),
addr_ref,
count_ref,
)
Base.uv_error("getlocalip", err)
addr, count = addr_ref[], count_ref[]
for i in 0:(count - 1)
current_addr = addr + i * _sizeof_uv_interface_address
# Note: Extracting interface name without a proper accessor
name = unsafe_string(unsafe_load(Ptr{Cstring}(current_addr)))
is_internal =
ccall(
:jl_uv_interface_address_is_internal, Int32, (Ptr{UInt8},), current_addr
) == 1
sockaddr = ccall(
:jl_uv_interface_address_sockaddr, Ptr{Cvoid}, (Ptr{UInt8},), current_addr
)
ip = if ccall(_jl_sockaddr_is_ip4, Int32, (Ptr{Cvoid},), sockaddr) == 1
IPv4(ntoh(ccall(:jl_sockaddr_host4, UInt32, (Ptr{Cvoid},), sockaddr)))
elseif ccall(_jl_sockaddr_is_ip6, Int32, (Ptr{Cvoid},), sockaddr) == 1
addr6 = Ref{UInt128}()
scope_id = ccall(
:jl_sockaddr_host6, UInt32, (Ptr{Cvoid}, Ref{UInt128}), sockaddr, addr6
)
IPv6(ntoh(addr6[]))
end
push!(addresses, InterfaceAddress(name, is_internal, ip))
end
ccall(:uv_free_interface_addresses, Cvoid, (Ptr{UInt8}, Int32), addr, count)
return addresses
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 7876 | const BATCH_SPAWN_REGEX = r"Spawning (array )?job: (?<id>[0-9a-f\-]+)(?(1) \(n=(?<n>\d+)\))"
# Test inner constructor
@testset "AWSBatchManager" begin
@testset "constructors" begin
@testset "inner" begin
mgr = AWSBatchManager(
1,
2,
"job-definition",
"job-name",
"job-queue",
1000,
"us-east-2",
Minute(10),
ip"1.0.0.0",
ip"2.0.0.0",
)
# Validate that no additional fields were added without the tests being updated
@test fieldcount(AWSBatchManager) == 10
@test mgr.min_workers == 1
@test mgr.max_workers == 2
@test mgr.job_definition == "job-definition"
@test mgr.job_name == "job-name"
@test mgr.job_queue == "job-queue"
@test mgr.job_memory == 1000
@test mgr.region == "us-east-2"
@test mgr.timeout == Minute(10)
@test mgr.min_ip == ip"1.0.0.0"
@test mgr.max_ip == ip"2.0.0.0"
@test launch_timeout(mgr) == Minute(10)
@test desired_workers(mgr) == (1, 2)
end
@testset "keywords" begin
mgr = AWSBatchManager(
3,
4;
definition="keyword-def",
name="keyword-name",
queue="keyword-queue",
memory=1000,
region="us-west-1",
timeout=Second(5),
min_ip=ip"3.0.0.0",
max_ip=ip"4.0.0.0",
)
@test mgr.min_workers == 3
@test mgr.max_workers == 4
@test mgr.job_definition == "keyword-def"
@test mgr.job_name == "keyword-name"
@test mgr.job_queue == "keyword-queue"
@test mgr.job_memory == 1000
@test mgr.region == "us-west-1"
@test mgr.timeout == Second(5)
@test mgr.min_ip == ip"3.0.0.0"
@test mgr.max_ip == ip"4.0.0.0"
end
@testset "defaults" begin
mgr = AWSBatchManager(0)
@test mgr.min_workers == 0
@test mgr.max_workers == 0
@test isempty(mgr.job_definition)
@test isempty(mgr.job_name)
@test isempty(mgr.job_queue)
@test mgr.job_memory == -1
@test mgr.region == "us-east-1"
@test mgr.timeout == AWSClusterManagers.BATCH_TIMEOUT
@test mgr.min_ip == ip"0.0.0.0"
@test mgr.max_ip == ip"255.255.255.255"
@test launch_timeout(mgr) == AWSClusterManagers.BATCH_TIMEOUT
@test desired_workers(mgr) == (0, 0)
end
@testset "num workers" begin
@test_throws ArgumentError AWSBatchManager(-1)
@test_throws ArgumentError AWSBatchManager(2, 1)
@test desired_workers(AWSBatchManager(0, 0)) == (0, 0)
@test desired_workers(AWSBatchManager(2)) == (2, 2)
@test desired_workers(AWSBatchManager(3:4)) == (3, 4)
@test_throws MethodError AWSBatchManager(3:1:4)
@test_throws MethodError AWSBatchManager(3:2:4)
end
@testset "queue env variable" begin
# Mock being run on an AWS batch job
withenv("WORKER_JOB_QUEUE" => "worker") do
# Fall back to using the WORKER_JOB_QUEUE environmental variable
mgr = AWSBatchManager(3)
@test mgr.job_queue == "worker"
# Use the queue passed in
mgr = AWSBatchManager(3; queue="special")
@test mgr.job_queue == "special"
end
end
end
@testset "equality" begin
@test AWSBatchManager(3) == AWSBatchManager(3)
end
@testset "addprocs" begin
mock_queue_arn = "arn:aws:batch:us-east-1:000000000000:job-queue/queue"
# Note: due to the `addprocs` running our code with @async it can be difficult to
# debug failures in these tests. If a failure does occur it is recommended you run
# the code with `launch(AWSBatchManager(...), Dict(), [], Condition())` to get a
# useful stacktrace.
@testset "success" begin
patches = [
@patch AWSBatch.JobQueue(queue::AbstractString) = JobQueue(mock_queue_arn)
@patch AWSBatch.max_vcpus(::JobQueue) = 1
@patch function AWSBatch.run_batch(; kwargs...)
@async run(kwargs[:cmd])
return BatchJob("00000000-0000-0000-0000-000000000001")
end
]
apply(patches) do
# Get an initial list of processes
init_procs = procs()
# Add a single AWSBatchManager worker
added_procs = @test_log LOGGER "notice" BATCH_SPAWN_REGEX begin
addprocs(AWSBatchManager(1))
end
# Check that the workers are available
@test length(added_procs) == 1
@test procs() == vcat(init_procs, added_procs)
# Remove the added workers
rmprocs(added_procs; waitfor=5.0)
# Double check that rmprocs worked
@test init_procs == procs()
end
end
@testset "worker timeout" begin
patches = [
@patch AWSBatch.JobQueue(queue::AbstractString) = JobQueue(mock_queue_arn)
@patch AWSBatch.max_vcpus(::JobQueue) = 1
@patch function AWSBatch.run_batch(; kwargs...)
# Avoiding spawning a worker process
return BatchJob("00000000-0000-0000-0000-000000000002")
end
]
@test_throws TaskFailedException apply(patches) do
@test_log LOGGER "notice" BATCH_SPAWN_REGEX begin
addprocs(AWSBatchManager(1; timeout=Second(1)))
end
end
end
@testset "VCPU limit" begin
@testset "minimum exceeds" begin
patches = [
@patch function AWSBatch.JobQueue(queue::AbstractString)
return JobQueue(mock_queue_arn)
end
@patch AWSBatch.max_vcpus(::JobQueue) = 3
]
apply(patches) do
@test_throws TaskFailedException addprocs(
AWSBatchManager(4; timeout=Second(5))
)
@test nprocs() == 1
end
end
@testset "maximum exceeds" begin
patches = [
@patch function AWSBatch.JobQueue(queue::AbstractString)
return JobQueue(mock_queue_arn)
end
@patch AWSBatch.max_vcpus(::JobQueue) = 1
@patch function AWSBatch.run_batch(; kwargs...)
for _ in 1:kwargs[:num_jobs]
@async run(kwargs[:cmd])
end
return BatchJob("00000000-0000-0000-0000-000000000004")
end
]
msg = string(
"Due to the max VCPU limit (1) most likely only a partial amount ",
"of the requested workers (2) will be spawned.",
)
apply(patches) do
added_procs = @test_log LOGGER "warn" msg begin
addprocs(AWSBatchManager(0:2; timeout=Second(5)))
end
@test length(added_procs) > 0
rmprocs(added_procs; waitfor=5.0)
end
end
end
end
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 5161 | @testset "AWSBatchNodeManager" begin
@testset "AWS_BATCH_JOB_ID DNE" begin
withenv(
"AWS_BATCH_JOB_MAIN_NODE_INDEX" => 1
) do
@test_throws ErrorException AWSBatchNodeManager()
end
end
@testset "AWS_BATCH_JOB_MAIN_NODE_INDEX DNE" begin
withenv(
"AWS_BATCH_JOB_ID" => "job_id"
) do
@test_throws ErrorException AWSBatchNodeManager()
end
end
@testset "AWS_BATCH_JOB_NUM_NODES DNE" begin
withenv(
"AWS_BATCH_JOB_ID" => "job_id",
"AWS_BATCH_JOB_NODE_INDEX" => 1,
"AWS_BATCH_JOB_MAIN_NODE_INDEX" => 1,
) do
@test_throws KeyError AWSBatchNodeManager()
end
end
@testset "AWS_BATCH_JOB_NODE_INDEX != AWS_BATCH_JOB_MAIN_NODE_INDEX" begin
withenv(
"AWS_BATCH_JOB_ID" => "job_id",
"AWS_BATCH_JOB_NODE_INDEX" => 0,
"AWS_BATCH_JOB_MAIN_NODE_INDEX" => 1
) do
@test_throws ErrorException AWSBatchNodeManager()
end
end
@testset "AWS_BATCH_JOB_NUM_NODES -- String" begin
withenv(
"AWS_BATCH_JOB_ID" => "job_id",
"AWS_BATCH_JOB_MAIN_NODE_INDEX" => 1,
"AWS_BATCH_JOB_NODE_INDEX" => 1,
"AWS_BATCH_JOB_NUM_NODES" => "foobar"
) do
@test_throws ArgumentError AWSBatchNodeManager()
end
end
@testset "AWS_BATCH_JOB_NUM_NODES -- Int" begin
expected_workers = 9
withenv(
"AWS_BATCH_JOB_ID" => "job_id",
"AWS_BATCH_JOB_MAIN_NODE_INDEX" => 1,
"AWS_BATCH_JOB_NODE_INDEX" => 1,
"AWS_BATCH_JOB_NUM_NODES" => expected_workers + 1 # Add one to account for the manager
) do
result = AWSBatchNodeManager()
@test result.num_workers == expected_workers
@test result.timeout == AWSClusterManagers.AWS_BATCH_NODE_TIMEOUT
end
end
@testset "AWS_BATCH_JOB_NUM_NODES -- Int as a String" begin
expected_workers = 9
withenv(
"AWS_BATCH_JOB_ID" => "job_id",
"AWS_BATCH_JOB_MAIN_NODE_INDEX" => 1,
"AWS_BATCH_JOB_NODE_INDEX" => 1,
"AWS_BATCH_JOB_NUM_NODES" => string(expected_workers + 1) # Add one to account for the manager
) do
result = AWSBatchNodeManager()
@test result.num_workers == expected_workers
@test result.timeout == AWSClusterManagers.AWS_BATCH_NODE_TIMEOUT
end
end
@testset "AWS_BATCH_JOB_NUM_NODES -- Set timeout" begin
expected_workers = 9
expected_timeout = Second(5)
withenv(
"AWS_BATCH_JOB_ID" => "job_id",
"AWS_BATCH_JOB_MAIN_NODE_INDEX" => 1,
"AWS_BATCH_JOB_NODE_INDEX" => 1,
"AWS_BATCH_JOB_NUM_NODES" => expected_workers + 1 # Add one to account for the manager
) do
result = AWSBatchNodeManager(; timeout=expected_timeout)
@test result.num_workers == expected_workers
@test result.timeout == expected_timeout
end
end
end
@testset "parse_job_id" begin
passing_cases = [
string(repeat("a", 36), "#123"),
string("0-", repeat("a", 34), "#123")
]
@testset "passing case: $(case)" for case in passing_cases
str = string("job_id:", case)
@test AWSClusterManagers.parse_job_id(str) == case
end
failing_cases = [
string(repeat("a", 35), "#123"), # Fails because too short
string(repeat("a", 37), "#123"), # Fails because too long
string(repeat("!", 36), "#123"), # Fails because non `a-z0-9-` before #
string(repeat("a", 36), "#"), # Fails because no decimal after #
string(repeat("a", 36), "#abc"), # Fails because non-decimal after #
]
@testset "failing case: $(case)" for case in failing_cases
str = string("job_id:", case)
@test_throws ErrorException AWSClusterManagers.parse_job_id(str)
end
end
@testset "parse_cookie" begin
@test AWSClusterManagers.parse_cookie("julia_cookie:1000") == "1000"
@test AWSClusterManagers.parse_cookie("julia_cookie:1.5") == "1"
@test AWSClusterManagers.parse_cookie("julia_cookie:foobar") == "foobar"
@test_throws ErrorException AWSClusterManagers.parse_cookie("julia_cookie:-1")
@test_throws ErrorException AWSClusterManagers.parse_cookie("foobar")
@test_throws ErrorException AWSClusterManagers.parse_cookie("foobar:julia_cookie:1")
end
@testset "parse_worker_timeout" begin
@test AWSClusterManagers.parse_worker_timeout("julia_worker_timeout:1000") == 1000
@test AWSClusterManagers.parse_worker_timeout("julia_worker_timeout:1.5") == 1
@test_throws ErrorException AWSClusterManagers.parse_worker_timeout("julia_worker_timeout:-1")
@test_throws ErrorException AWSClusterManagers.parse_worker_timeout("julia_worker_timeout:foobar")
@test_throws ErrorException AWSClusterManagers.parse_worker_timeout("foobar")
@test_throws ErrorException AWSClusterManagers.parse_worker_timeout("foobar:julia_worker_timeout:1")
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 20334 | # Ideally we would register a single job definition as part of the CloudFormation template
# and use overrides to change the image used. Unfortunately, this is not a supported
# override so we're left with a dilemma:
#
# 1. Define the job definition in CFN and change the image referenced by uploading a new
# Docker image with the same name.
# 2. Create a new job definition for each Docker image
# The first option is problematic when executing tests in parallel using the same stack. If
# two CI pipelines are running concurrently then the last Docker image to be pushed will be
# the one used by both pipelines (assumes the push completes before the batch job starts).
#
# We went with the second option as it is safer for parallel pipelines and allows us to
# still use overrides to modify other parts of the job definition.
function batch_node_job_definition(;
job_definition_name::AbstractString="$(STACK_NAME)-node",
image::AbstractString=TEST_IMAGE,
job_role_arn::AbstractString=STACK["TestBatchNodeJobRoleArn"],
)
manager_code = """
using AWSClusterManagers, Distributed, Memento
setlevel!(getlogger("root"), "debug", recursive=true)
addprocs(AWSBatchNodeManager())
println("NumProcs: ", nprocs())
for i in workers()
println("Worker job \$i: ", remotecall_fetch(() -> ENV["AWS_BATCH_JOB_NODE_INDEX"], i))
end
"""
bind_to = "--bind-to \$(ip -o -4 addr list eth0 | awk '{print \$4}' | cut -d/ -f1)"
worker_code = """
using AWSClusterManagers
start_batch_node_worker()
"""
return Dict(
"jobDefinitionName" => job_definition_name,
"type" => "multinode",
"nodeProperties" => Dict(
"numNodes" => 3,
"mainNode" => 0,
"nodeRangeProperties" => [
Dict(
"targetNodes" => "0",
"container" => Dict(
"image" => image,
"jobRoleArn" => job_role_arn,
"vcpus" => 1,
"memory" => 1024, # MiB
"command" => ["julia", "-e", manager_code],
),
),
Dict(
"targetNodes" => "1:",
"container" => Dict(
"image" => image,
"jobRoleArn" => job_role_arn,
"vcpus" => 1,
"memory" => 1024, # MiB
"command" => [
"bash",
"-c",
"julia $bind_to -e $(bash_quote(worker_code))",
],
),
),
],
),
# Retrying to handle EC2 instance failures and internal AWS issues:
# https://docs.aws.amazon.com/batch/latest/userguide/job_retries.html
"retryStrategy" => Dict("attempts" => 3),
)
end
# Use single quotes so that no shell interpolation occurs.
bash_quote(str::AbstractString) = string("'", replace(str, "'" => "'\\''"), "'")
# AWS Batch parallel multi-node jobs will only run on on-demand clusters. When running
# on spot the jobs will remain stuck in the RUNNABLE state
let ce = describe_compute_environment(STACK["ComputeEnvironmentArn"])
if ce["computeResources"]["type"] != "EC2" # on-demand
error(
"Aborting as compute environment $(STACK["ComputeEnvironmentArn"]) is not " *
"using on-demand instances which are required for AWS Batch multi-node " *
"parallel jobs.",
)
end
end
const BATCH_NODE_INDEX_REGEX = r"Worker job (?<worker_id>\d+): (?<node_index>\d+)"
const BATCH_NODE_JOB_DEF = register_job_definition(batch_node_job_definition()) # ARN
# Spawn all of the AWS Batch jobs at once in order to make online tests run faster. Each
# job spawned below has a corresponding testset. Ideally, the job spawning would be
# contained within the testset bun unfortunately that doesn't seem possible as `@sync` and
# `@testset` currently do not work together.
const BATCH_NODE_JOBS = Dict{String,BatchJob}()
let job_name = "test-worker-spawn-success"
BATCH_NODE_JOBS[job_name] = submit_job(;
job_name=job_name, job_definition=BATCH_NODE_JOB_DEF
)
end
let job_name = "test-worker-spawn-failure"
overrides = Dict(
"numNodes" => 2,
"nodePropertyOverrides" => [
Dict(
"targetNodes" => "1:",
"containerOverrides" => Dict("command" => ["bash", "-c", "exit 0"]),
),
],
)
BATCH_NODE_JOBS[job_name] = submit_job(;
job_name=job_name, job_definition=BATCH_NODE_JOB_DEF, node_overrides=overrides
)
end
let job_name = "test-worker-link-local"
overrides = Dict(
"numNodes" => 2,
"nodePropertyOverrides" => [
Dict(
"targetNodes" => "1:",
"containerOverrides" => Dict(
"command" => [
"julia",
"-e",
"""
using AWSClusterManagers, Memento
setlevel!(getlogger(), "debug", recursive=true)
try
start_batch_node_worker()
catch e # Prevents the job from failing so we can retry AWS errors
showerror(stderr, e, catch_backtrace())
end
""",
],
),
),
],
)
BATCH_NODE_JOBS[job_name] = submit_job(;
job_name=job_name, job_definition=BATCH_NODE_JOB_DEF, node_overrides=overrides
)
end
let job_name = "test-worker-link-local-bind-to"
bind_to = "--bind-to \$(ip -o -4 addr list ecs-eth0 | awk '{print \$4}' | cut -d/ -f1)"
worker_code = """
using AWSClusterManagers, Memento
setlevel!(getlogger("root"), "debug", recursive=true)
try
start_batch_node_worker()
catch e # Prevents the job from failing so we can retry AWS errors
showerror(stderr, e, catch_backtrace())
end
"""
overrides = Dict(
"numNodes" => 2,
"nodePropertyOverrides" => [
Dict(
"targetNodes" => "1:",
"containerOverrides" => Dict(
"command" => [
"bash",
"-c",
"julia $bind_to -e $(bash_quote(worker_code))",
],
),
),
],
)
BATCH_NODE_JOBS[job_name] = submit_job(;
job_name=job_name, job_definition=BATCH_NODE_JOB_DEF, node_overrides=overrides
)
end
let job_name = "test-slow-manager"
# Should match code in `batch_node_job_definition` but with an added delay
manager_code = """
using AWSClusterManagers, Distributed, Memento
setlevel!(getlogger("root"), "debug", recursive=true)
sleep(120)
addprocs(AWSBatchNodeManager())
println("NumProcs: ", nprocs())
for i in workers()
println("Worker job \$i: ", remotecall_fetch(() -> ENV["AWS_BATCH_JOB_NODE_INDEX"], i))
end
"""
overrides = Dict(
"numNodes" => 2,
"nodePropertyOverrides" => [
Dict(
"targetNodes" => "0",
"containerOverrides" =>
Dict("command" => ["julia", "-e", manager_code]),
),
],
)
BATCH_NODE_JOBS[job_name] = submit_job(;
job_name=job_name, job_definition=BATCH_NODE_JOB_DEF, node_overrides=overrides
)
end
let job_name = "test-worker-timeout"
# The default duration a worker process will wait for the manager to connect. For this
# test this is also the amount of time between when the early worker checks in with the
# manager and the late worker checks in.
#
# Note: Make sure to ignore any modification made on the local system that will not be
# present for the batch job.
worker_timeout = withenv("JULIA_WORKER_TIMEOUT" => nothing) do
Distributed.worker_timeout() # In seconds
end
# Amount of time it from the job start to executing `start_worker` (when the worker
# timeout timer starts).
start_delay = 10 # In seconds
# Modify the manager to extend the worker check-in time. Ensures that the worker doesn't
# timeout before the late worker checks in.
manager_code = """
using AWSClusterManagers, Dates, Distributed, Memento
using AWSClusterManagers: AWS_BATCH_NODE_TIMEOUT
setlevel!(getlogger(), "debug", recursive=true)
check_in_timeout = Second(AWS_BATCH_NODE_TIMEOUT) + Second($(worker_timeout + start_delay))
addprocs(AWSBatchNodeManager(timeout=check_in_timeout))
println("NumProcs: ", nprocs())
for i in workers()
println("Worker job \$i: ", remotecall_fetch(() -> ENV["AWS_BATCH_JOB_NODE_INDEX"], i))
end
# Failure to launch all workers should trigger a retry via a non-zero exit code
nworkers() == 2 || exit(2)
"""
bind_to = "--bind-to \$(ip -o -4 addr list eth0 | awk '{print \$4}' | cut -d/ -f1)"
# Note: The worker code logic tries to ensure that the execution of
# `start_batch_node_worker` occurs around the same time for all workers.
#
# Requires that worker jobs have external network access and have permissions for IAM
# access `batch:DescribeJobs`.
worker_code = """
using AWSBatch, AWSClusterManagers, Memento
setlevel!(getlogger(), "debug")
setlevel!(getlogger("AWSClusterManager"), "debug")
node_index = parse(Int, ENV["AWS_BATCH_JOB_NODE_INDEX"])
sibling_index = node_index % 2 + 1 # Assumes only 2 workers
function wait_job_start(job::BatchJob)
started_at = nothing
while started_at === nothing
started_at = get(describe(job), "startedAt", nothing)
sleep(10)
end
end
sibling_job_id = replace(
ENV["AWS_BATCH_JOB_ID"],
"#\$node_index" => "#\$sibling_index",
)
@info "Waiting for sibling job: \$sibling_job_id"
wait_job_start(BatchJob(sibling_job_id))
# Delaying a worker from reporting to the manager will delay the manager and cause
# the workers that did report in to encounter the worker timeout. The delay here
# should be less than the manager timeout to allow the delayed worker to still
# report in.
if node_index == 2 # The late worker will
@info "Sleeping"
sleep($(worker_timeout + start_delay))
end
start_batch_node_worker()
"""
overrides = Dict(
"numNodes" => 3,
"nodePropertyOverrides" => [
Dict(
"targetNodes" => "0",
"containerOverrides" =>
Dict("command" => ["julia", "-e", manager_code]),
),
Dict(
"targetNodes" => "1:",
"containerOverrides" => Dict(
"command" => [
"bash",
"-c",
"julia $bind_to -e $(bash_quote(worker_code))",
],
),
),
],
)
BATCH_NODE_JOBS[job_name] = submit_job(;
job_name=job_name, job_definition=BATCH_NODE_JOB_DEF, node_overrides=overrides
)
end
@testset "AWSBatchNodeManager (online)" begin
# Note: Alternatively we could test report via Mocking but since the function is only
# used for online testing and this particular test doesn't require an additional AWS
# Batch job we'll test it here instead
@testset "Report" begin
job = BATCH_NODE_JOBS["test-worker-spawn-success"]
manager_job = BatchJob(job.id * "#0")
wait_finish(job)
# Validate the report contains important information
report_log = report(manager_job)
test_results = [
@test occursin(manager_job.id, report_log)
@test occursin(string(status(manager_job)), report_log)
@test occursin(status_reason(manager_job), report_log)
]
if any(r -> !(r isa Test.Pass), test_results)
@info "Details for manager:\n$report_log"
end
end
@testset "Success" begin
job = BATCH_NODE_JOBS["test-worker-spawn-success"]
manager_job = BatchJob(job.id * "#0")
worker_jobs = BatchJob.(job.id .* ("#1", "#2"))
wait_finish(job)
@test status(manager_job) == AWSBatch.SUCCEEDED
@test all(status(w) == AWSBatch.SUCCEEDED for w in worker_jobs)
# Expect 2 workers to check in and the worker ID order to match the node index order
manager_log = log_messages(manager_job)
matches = collect(eachmatch(BATCH_NODE_INDEX_REGEX, manager_log))
test_results = [
@test length(matches) == 2
@test matches[1][:worker_id] == "2"
@test matches[1][:node_index] == "1"
@test matches[2][:worker_id] == "3"
@test matches[2][:node_index] == "2"
]
# Display the logs for all the jobs if any of the log tests fail
if any(r -> !(r isa Test.Pass), test_results)
@info "Details for manager:\n$(report(manager_job))"
@info "Details for worker 1:\n$(report(worker_jobs[1]))"
@info "Details for worker 2:\n$(report(worker_jobs[2]))"
end
end
@testset "Worker spawn failure" begin
# Simulate a batch job which failed to start
job = BATCH_NODE_JOBS["test-worker-spawn-failure"]
manager_job = BatchJob(job.id * "#0")
worker_job = BatchJob(job.id * "#1")
wait_finish(job)
# Even though the worker failed to spawn the cluster manager continues with the
# subset of workers that reported in.
@test status(manager_job) == AWSBatch.SUCCEEDED
@test status(worker_job) == AWSBatch.SUCCEEDED
manager_log = log_messages(manager_job)
worker_log = log_messages(worker_job; retries=0)
test_results = [
@test occursin("Only 0 of the 1 workers job have reported in", manager_log)
@test isempty(worker_log)
]
# Display the logs for all the jobs if any of the log tests fail
if any(r -> !(r isa Test.Pass), test_results)
@info "Details for manager:\n$(report(manager_job))"
@info "Details for worker:\n$(report(worker_job))"
end
end
@testset "Worker using link-local address" begin
# Failing to specify a `--bind-to` address results in the link-local address being
# reported from the workers which cannot be used by the manager to connect.
job = BATCH_NODE_JOBS["test-worker-link-local"]
manager_job = BatchJob(job.id * "#0")
worker_job = BatchJob(job.id * "#1")
wait_finish(job)
@test status(manager_job) == AWSBatch.SUCCEEDED
# Note: In practice worker jobs would actually fail but we catch the failure so that
# we can retry the jobs for other AWS failure cases
@test status(worker_job) == AWSBatch.SUCCEEDED
manager_log = log_messages(manager_job)
worker_log = log_messages(worker_job)
test_results = [
@test occursin("Only 0 of the 1 workers job have reported in", manager_log)
@test occursin("Aborting due to use of link-local address", worker_log)
]
# Display the logs for all the jobs if any of the log tests fail
if any(r -> !(r isa Test.Pass), test_results)
@info "Details for manager:\n$(report(manager_job))"
@info "Details for worker:\n$(report(worker_job))"
end
end
@testset "Worker using link-local bind-to address" begin
# Accidentially specifying the link-local address in `--bind-to`.
job = BATCH_NODE_JOBS["test-worker-link-local-bind-to"]
manager_job = BatchJob(job.id * "#0")
worker_job = BatchJob(job.id * "#1")
wait_finish(job)
@test status(manager_job) == AWSBatch.SUCCEEDED
# Note: In practice worker jobs would actually fail but we catch the failure so that
# we can retry the jobs for other AWS failure cases
@test status(worker_job) == AWSBatch.SUCCEEDED
manager_log = log_messages(manager_job)
worker_log = log_messages(worker_job)
test_results = [
@test occursin("Only 0 of the 1 workers job have reported in", manager_log)
@test occursin("Aborting due to use of link-local address", worker_log)
]
# Display the logs for all the jobs if any of the log tests fail
if any(r -> !(r isa Test.Pass), test_results)
@info "Details for manager:\n$(report(manager_job))"
@info "Details for worker:\n$(report(worker_job))"
end
end
@testset "Worker connects before manager is ready" begin
# If the workers manage to start and attempt to connect to the manager before the
# manager is listening for connections the worker should attempt to reconnect.
job = BATCH_NODE_JOBS["test-slow-manager"]
manager_job = BatchJob(job.id * "#0")
worker_job = BatchJob(job.id * "#1")
wait_finish(job)
@test status(manager_job) == AWSBatch.SUCCEEDED
@test status(worker_job) == AWSBatch.SUCCEEDED
manager_log = log_messages(manager_job)
worker_log = log_messages(worker_job)
test_results = [
@test occursin("All workers have successfully reported in", manager_log)
]
# Display the logs for all the jobs if any of the log tests fail
# When the worker fails to connect the following error will occur:
# `ERROR: IOError: connect: connection refused (ECONNREFUSED)`
if any(r -> !(r isa Test.Pass), test_results)
@info "Details for manager:\n$(report(manager_job))"
@info "Details for worker:\n$(report(worker_job))"
end
end
@testset "Worker timeout" begin
# In order to modify the Julia worker ordering the manager needs to wait for all
# worker to check-in before the manager connects to any worker. Due to this
# restriction it is possible that worker may wait longer than the
# `Distributed.worker_timeout()` at which time the worker will self-terminate. If
# this occurs during the cluster setup the manager node will hang and not proceed
# past the initial cluster setup.
#
# If enough workers exist it is possible that the worker will self-terminate due to
# hitting a timeout (The issue has been seen with as low as 30 nodes with a timeout
# of 60 seconds). We typically shouldn't encounter this due to increasing the worker
# timeout.
#
# Log example:
# ```
# [debug | AWSClusterManagers]: Worker connected from node B
# [debug | AWSClusterManagers]: Worker connected from node A
# ...
# [debug | AWSClusterManagers]: All workers have successfully reported in
# Worker X terminated.
# Worker Y terminated.
# ...
# <manager stalled>
# ```
job = BATCH_NODE_JOBS["test-worker-timeout"]
manager_job = BatchJob(job.id * "#0")
early_worker_job = BatchJob(job.id * "#1")
late_worker_job = BatchJob(job.id * "#2")
wait_finish(job)
test_results = [
@test status(manager_job) == AWSBatch.SUCCEEDED
@test status(early_worker_job) == AWSBatch.SUCCEEDED
@test status(late_worker_job) == AWSBatch.SUCCEEDED
]
if any(r -> !(r isa Test.Pass), test_results)
@info "Details for manager:\n$(report(manager_job))"
@info "Details for early worker:\n$(report(early_worker_job))"
@info "Details for late worker:\n$(report(late_worker_job))"
end
end
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 7881 | # Worst case 15 minute timeout. If the compute environment has just scaled it will wait
# 8 minutes before scaling again. Spot instance requests can take some time to be fufilled
# but are usually instant and instances take around 4 minutes before they are ready.
const TIMEOUT = Minute(15)
# Scrapes the log output to determine the worker job IDs as stated by the manager
function scrape_worker_job_ids(output::AbstractString)
m = match(BATCH_SPAWN_REGEX, output)
if m !== nothing
worker_job = m[:id]
if m[:n] !== nothing
num_workers = parse(Int, m[:n])
return String["$worker_job:$i" for i in 0:(num_workers - 1)]
else
return String["$worker_job"]
end
else
return String[]
end
end
function run_batch_job(
image_name::AbstractString,
num_workers::Integer;
timeout::Period=TIMEOUT,
should_fail::Bool=false,
)
# TODO: Use AWS Batch job parameters to avoid re-registering the job
timeout_secs = Dates.value(Second(timeout))
# Will be running the HEAD revision of the code remotely
# Note: Pkg.checkout doesn't work on untracked branches / SHAs with Julia 0.5.1
code = """
using AWSClusterManagers: AWSClusterManagers, AWSBatchManager
using Dates: Second
using Distributed
using Memento
Memento.config!("debug"; fmt="{msg}")
setlevel!(getlogger(AWSClusterManagers), "debug")
addprocs(
AWSBatchManager(
$num_workers;
queue="$(STACK["WorkerJobQueueArn"])",
memory=512,
timeout=Second($(timeout_secs - 15))
)
)
println("NumProcs: ", nprocs())
@everywhere using AWSClusterManagers: container_id
for i in workers()
println("Worker container \$i: ", remotecall_fetch(container_id, i))
println("Worker job \$i: ", remotecall_fetch(() -> ENV["AWS_BATCH_JOB_ID"], i))
end
println("Manager Complete")
"""
# Note: The manager can run out of memory with enough workers:
# - 64 workers with a manager with 1024 MB of memory
info(LOGGER, "Submitting AWS Batch job with $num_workers workers")
job = run_batch(;
name=STACK["JobName"] * "-n$num_workers",
queue=STACK["ManagerJobQueueArn"],
definition=STACK["JobDefinitionName"],
image=image_name,
role=STACK["JobRoleArn"],
vcpus=1,
memory=2048,
cmd=Cmd(["julia", "-e", code]),
)
# If no compute environment resources are available it could take around
# 5 minutes before the manager job is running
info(LOGGER, "Waiting for AWS Batch manager job $(job.id) to run (~5 minutes)")
start_time = time()
@test wait(state -> state < AWSBatch.RUNNING, job; timeout=timeout_secs) == true
info(LOGGER, "Manager spawning duration: $(time_str(time() - start_time))")
# Once the manager job is running it will spawn additional AWS Batch jobs as
# the workers.
#
# Since compute environments only scale every 5 minutes we will definitely have
# to wait if we scaled up for the mananager job. To reduce this wait time make
# sure you have one VCPU available for the manager to start right away.
info(LOGGER, "Waiting for AWS Batch workers and manager job to complete (~5 minutes)")
start_time = time()
if should_fail
@test wait(job, [AWSBatch.FAILED], [AWSBatch.SUCCEEDED]; timeout=timeout_secs) ==
true
else
@test wait(job, [AWSBatch.SUCCEEDED]; timeout=timeout_secs) == true
end
info(LOGGER, "Worker spawning duration: $(time_str(time() - start_time))")
# Remove the job definition as it is specific to a revision
job_definition = JobDefinition(job)
deregister(job_definition)
# CloudWatch can take several seconds to ingest the log record so we'll wait until we
# find the end-of-log message.
# Note: Do not assume that the "Manager Complete" message will be the last thing written
# to the log as busy worker may cause additional warnings messages.
# https://github.com/JuliaCloud/AWSClusterManagers.jl/issues/10
output = ""
if status(job) == AWSBatch.SUCCEEDED
log_wait_start = time()
while true
events = log_events(job)
if events !== nothing &&
!isempty(events) &&
any(e -> e.message == "Manager Complete", events)
output = join(
[string(event.timestamp, " ", event.message) for event in events], '\n'
)
break
elseif time() - log_wait_start > 60
error("CloudWatch logs have not completed ingestion within 1 minute")
end
sleep(5)
end
end
return job, output
end
@testset "AWSBatchManager (online)" begin
# Note: Start with the largest number of workers so the remaining tests don't have
# to wait for the cluster to scale up on subsequent tests.
@testset "Num workers ($num_workers)" for num_workers in [10, 1, 0]
job, output = run_batch_job(TEST_IMAGE, num_workers)
m = match(r"(?<=NumProcs: )\d+", output)
if m !== nothing
num_procs = parse(Int, m.match)
else
error("The logs do not contain the `NumProcs` for job \"$(job.id)\".")
end
# Spawned are the AWS Batch job IDs reported upon job submission at launch
# while reported is the self-reported job ID of each worker.
spawned_jobs = scrape_worker_job_ids(output)
reported_jobs = [
m[1] for m in eachmatch(r"Worker job \d+: ([0-9a-f\-]+(?:\:\d+)?)", output)
]
reported_containers = [
m[1] for m in eachmatch(r"Worker container \d+: ([0-9a-f]*)", output)
]
@test num_procs == num_workers + 1
if num_workers > 0
@test length(reported_jobs) == num_workers
@test Set(reported_jobs) == Set(spawned_jobs)
else
# When we request no workers the manager job will be treated as the worker
@test length(reported_jobs) == 1
@test reported_jobs == [job.id]
end
# Ensure that the container IDs were found
@test all(.!isempty.(reported_containers))
# Determine the image name from an AWS Batch job ID.
job_image_name(job_id::AbstractString) = job_image_name(BatchJob(job_id))
job_image_name(job::BatchJob) = describe(job)["container"]["image"]
@test TEST_IMAGE == job_image_name(job) # Manager's image
@test all(TEST_IMAGE .== job_image_name.(spawned_jobs))
# Report some details about the job
d = describe(job)
created_at = Dates.unix2datetime(d["createdAt"] / 1000)
started_at = Dates.unix2datetime(d["startedAt"] / 1000)
stopped_at = Dates.unix2datetime(d["stoppedAt"] / 1000)
# TODO: Unless I'm forgetting something just extracting the seconds from the
# milliseconds is awkward
launch_duration = Dates.value(started_at - created_at) / 1000
run_duration = Dates.value(stopped_at - started_at) / 1000
info(LOGGER, "Job launch duration: $(time_str(launch_duration))")
info(LOGGER, "Job run duration: $(time_str(run_duration))")
end
@testset "exceed worker limit" begin
num_workers = typemax(Int64)
job, output = run_batch_job(TEST_IMAGE, num_workers; should_fail=true)
# Spawned are the AWS Batch job IDs reported upon job submission at launch
# while reported is the self-reported job ID of each worker.
spawned_jobs = scrape_worker_job_ids(output)
@test match(r"(?<=NumProcs: )\d+", output) === nothing
@test isempty(spawned_jobs)
end
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 2775 | @testset "container_id" begin
@testset "docker regex" begin
container_id = "26c927d78b3a0ac080354a74649d61cec26c3064426f6173b242356e75a324e3"
cgroup = """
13:name=systemd:/docker-ce/docker/$container_id
12:pids:/docker-ce/docker/$container_id
11:hugetlb:/docker-ce/docker/$container_id
10:net_prio:/docker-ce/docker/$container_id
9:perf_event:/docker-ce/docker/$container_id
8:net_cls:/docker-ce/docker/$container_id
7:freezer:/docker-ce/docker/$container_id
6:devices:/docker-ce/docker/$container_id
5:memory:/docker-ce/docker/$container_id
4:blkio:/docker-ce/docker/$container_id
3:cpuacct:/docker-ce/docker/$container_id
2:cpu:/docker-ce/docker/$container_id
1:cpuset:/docker-ce/docker/$container_id
"""
m = match(AWSClusterManagers.CGROUP_REGEX, cgroup)
@test m !== nothing
@test m["container_id"] == container_id
end
@testset "batch regex" begin
job_id = "69d95a04d3134530bee5a65def33a303"
container_id = "e799b9182976f8298065419945d32a4398f1280e616199448729f5b72b8e81ef"
cgroup = """
9:perf_event:/ecs/$job_id/$container_id
8:memory:/ecs/$job_id/$container_id
7:hugetlb:/ecs/$job_id/$container_id
6:freezer:/ecs/$job_id/$container_id
5:devices:/ecs/$job_id/$container_id
4:cpuset:/ecs/$job_id/$container_id
3:cpuacct:/ecs/$job_id/$container_id
2:cpu:/ecs/$job_id/$container_id
1:blkio:/ecs/$job_id/$container_id
"""
m = match(AWSClusterManagers.CGROUP_REGEX, cgroup)
@test m !== nothing
@test m["container_id"] == container_id
end
@testset "GitHub Actions regex" begin
container_id = "cf0888f8246174f11a08a07911abd5993da1e2f7b0e28103cc5799fe486debee"
cgroup = """
12:hugetlb:/actions_job/$container_id
11:blkio:/actions_job/$container_id
10:rdma:/
9:perf_event:/actions_job/$container_id
8:freezer:/actions_job/$container_id
7:devices:/actions_job/$container_id
6:net_cls,net_prio:/actions_job/$container_id
5:memory:/actions_job/$container_id
4:pids:/actions_job/$container_id
3:cpu,cpuacct:/actions_job/$container_id
2:cpuset:/actions_job/$container_id
1:name=systemd:/actions_job/$container_id
0::/system.slice/containerd.service
"""
m = match(AWSClusterManagers.CGROUP_REGEX, cgroup)
@test m !== nothing
@test m["container_id"] == container_id
end
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 4480 | using JSON
# Return the long image SHA256 identifier using various ways of referencing images
function full_image_sha(image::AbstractString)
json = JSON.parse(read(`docker inspect $image`, String))
return last(split(json[1]["Id"], ':'))
end
const DOCKER_SPAWN_REGEX = r"^Spawning container: [0-9a-z]{12}$"
@testset "DockerManager" begin
# A docker image name which is expected to not exist on the local system.
mock_image = "x5cn2a7hzq4k"
@testset "constructors" begin
@testset "inner" begin
mgr = DockerManager(2, mock_image, Minute(10), ip"1.0.0.0", ip"2.0.0.0")
# Validate that no additional fields were added without the tests being updated
@test fieldcount(DockerManager) == 5
@test mgr.num_workers == 2
@test mgr.image == mock_image
@test mgr.timeout == Minute(10)
@test mgr.min_ip == ip"1.0.0.0"
@test mgr.max_ip == ip"2.0.0.0"
@test launch_timeout(mgr) == Minute(10)
@test desired_workers(mgr) == (2, 2)
end
@testset "keywords" begin
mgr = DockerManager(
3;
image=mock_image,
timeout=Minute(12),
min_ip=ip"3.0.0.0",
max_ip=ip"4.0.0.0",
)
@test mgr.num_workers == 3
@test mgr.image == mock_image
@test mgr.timeout == Minute(12)
@test mgr.min_ip == ip"3.0.0.0"
@test mgr.max_ip == ip"4.0.0.0"
end
@testset "defaults" begin
patch = @patch AWSClusterManagers.image_id() = mock_image
apply(patch) do
mgr = DockerManager(0)
@test mgr.num_workers == 0
@test mgr.image == mock_image
@test mgr.timeout == AWSClusterManagers.DOCKER_TIMEOUT
@test mgr.min_ip == ip"0.0.0.0"
@test mgr.max_ip == ip"255.255.255.255"
end
end
@testset "num workers" begin
# Define keywords which are required to avoid mocking
kwargs = Dict(:image => mock_image)
@test_throws ArgumentError DockerManager(-1; kwargs...)
@test desired_workers(DockerManager(0; kwargs...)) == (0, 0)
@test desired_workers(DockerManager(2; kwargs...)) == (2, 2)
# Note: DockerManager does not support ranges
@test_throws MethodError DockerManager(1, 2; kwargs...)
@test_throws MethodError DockerManager(3:4; kwargs...)
end
end
@testset "equality" begin
patch = @patch AWSClusterManagers.image_id() = mock_image
apply(patch) do
@test DockerManager(3) == DockerManager(3)
end
end
@testset "addprocs" begin
@testset "success" begin
patch = @patch function read(cmd::AbstractCmd, ::Type{String})
# Extract original `override_command` using image position:
# "docker run [OPTIONS] IMAGE [COMMAND] [ARG...]"
i = findfirst(isequal(mock_image), collect(cmd))
override_cmd = Cmd(cmd[(i + 1):end])
@async run(override_cmd)
return "000000000001"
end
apply(patch) do
# Get an initial list of processes
init_procs = procs()
# Add a single AWSBatchManager worker
added_procs = @test_log LOGGER "notice" DOCKER_SPAWN_REGEX begin
addprocs(DockerManager(1, mock_image))
end
# Check that the workers are available
@test length(added_procs) == 1
@test procs() == vcat(init_procs, added_procs)
# Remove the added workers
rmprocs(added_procs; waitfor=5.0)
# Double check that rmprocs worked
@test init_procs == procs()
end
end
@testset "worker timeout" begin
patch = @patch function read(cmd::AbstractCmd, ::Type{String})
# Avoiding spawning a worker process
return "000000000002"
end
@test_throws TaskFailedException apply(patch) do
@test_log LOGGER "notice" DOCKER_SPAWN_REGEX begin
addprocs(DockerManager(1, mock_image, Second(1)))
end
end
end
end
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 3256 | @testset "DockerManager (online)" begin
@testset "docker.sock" begin
# Make sure that the UNIX socket that the Docker daemon listens to exists.
# Without this we will be unable to spawn worker containers.
@test ispath("/var/run/docker.sock")
end
@testset "container_id" begin
container_id = read(
```
docker run
-i $TEST_IMAGE
julia -e "using AWSClusterManagers: container_id; print(container_id())"
```,
String,
)
test_result = @test !isempty(container_id)
# Display the contents of /proc/self/cgroup from within the Docker container for
# easy debugging.
if !(test_result isa Test.Pass)
cgroup = read(`docker run -i $TEST_IMAGE cat /proc/self/cgroup`, String)
@info "Contents of /proc/self/cgroup in Docker container environment:\n\n$(cgroup)"
end
end
@testset "image_id" begin
image_id = read(
```
docker run
-v /var/run/docker.sock:/var/run/docker.sock
-i $TEST_IMAGE
julia -e "using AWSClusterManagers: image_id; print(image_id())"
```,
String,
)
@test !isempty(image_id)
end
@testset "DockerManager" begin
# Note: Julia packages used here must be explicitly added to the environment
# within the Dockerfile.
num_workers = 3
code = """
using AWSClusterManagers: AWSClusterManagers, DockerManager
using Distributed
using Memento
Memento.config!("debug"; fmt="{msg}")
setlevel!(getlogger(AWSClusterManagers), "debug")
addprocs(DockerManager($num_workers))
println("NumProcs: ", nprocs())
@everywhere using AWSClusterManagers: container_id
for i in workers()
container = remotecall_fetch(container_id, i)
println("Worker container \$i: \$container")
println("Worker image \$i: \$(AWSClusterManagers.image_id(container))")
end
"""
# Run the code in a docker container, but replace the newlines with semi-colons.
output = read(
```
docker run
--network=host
-v /var/run/docker.sock:/var/run/docker.sock
-i $TEST_IMAGE
julia -e $(replace(code, r"\n+" => "; "))
```,
String,
)
m = match(r"(?<=NumProcs: )\d+", output)
num_procs = m !== nothing ? parse(Int, m.match) : -1
# Spawned is the list container IDs reported by the manager upon launch while
# reported is the self-reported container ID of each worker.
spawned_containers = map(
m -> m.match, eachmatch(r"(?<=Spawning container: )[0-9a-f\-]+", output)
)
reported_containers = map(
m -> m.match, eachmatch(r"(?<=Worker container \d: )[0-9a-f\-]+", output)
)
reported_images = map(
m -> m.match, eachmatch(r"(?<=Worker image \d: )[0-9a-f\-]+", output)
)
@test num_procs == num_workers + 1
@test length(reported_containers) == num_workers
@test Set(spawned_containers) == Set(reported_containers)
@test all(full_image_sha(TEST_IMAGE) .== reported_images)
end
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 4471 | using AWS
using AWSBatch
using AWSClusterManagers
using AWSClusterManagers: desired_workers, launch_timeout
using AWSTools.CloudFormation: stack_output
using AWSTools.Docker: Docker
using Base: AbstractCmd
using Dates
using Distributed
using JSON: JSON
using LibGit2
using Memento
using Memento.TestUtils: @test_log
using Mocking
using Printf: @sprintf
using Sockets
using Test
@service Batch
Mocking.activate()
const LOGGER = Memento.config!("info"; fmt="[{date} | {level} | {name}]: {msg}")
# https://github.com/JuliaLang/julia/pull/32814
if VERSION < v"1.3.0-alpha.110"
const TaskFailedException = ErrorException
end
const PKG_DIR = abspath(@__DIR__, "..")
# Enables the running of the "docker" and "batch" online tests. e.g ONLINE=docker,batch
const ONLINE = split(strip(get(ENV, "ONLINE", "")), r"\s*,\s*"; keepempty=false)
# Run the tests on a stack created with the "test/batch.yml" CloudFormation template
const STACK_NAME = get(ENV, "STACK_NAME", "")
const STACK = !isempty(STACK_NAME) ? stack_output(STACK_NAME) : Dict()
const ECR =
!isempty(STACK) ? first(split(STACK["EcrUri"], ':')) : "aws-cluster-managers-test"
const GIT_DIR = joinpath(@__DIR__, "..", ".git")
const REV = if isdir(GIT_DIR)
try
readchomp(`git --git-dir $GIT_DIR rev-parse --short HEAD`)
catch
# Fallback to using the full SHA when git is not installed
LibGit2.with(LibGit2.GitRepo(GIT_DIR)) do repo
string(LibGit2.GitHash(LibGit2.GitObject(repo, "HEAD")))
end
end
else
# Fallback when package is not a git repository. Only should occur when running tests
# from inside a Docker container produced by the Dockerfile for this package.
"latest"
end
const TEST_IMAGE = "$ECR:$REV"
function registry_id(image::AbstractString)
m = match(r"^\d+", image)
return m.match
end
# Note: By building the Docker image prior to running any tests (instead of just before the
# image is required) we avoid having a Docker build log breaking up output from tests.
#
# Note: Users are expected to have Docker credential helpers setup such that images can be
# retrieved automatically.
if !isempty(ONLINE)
@info("Preparing Docker image for online tests")
# If the AWSClusterManager tests are being executed from within a container we will
# assume that the image currently in use should be used for online tests.
if !isempty(AWSClusterManagers.container_id())
run(`docker tag $(AWSClusterManagers.image_id()) $TEST_IMAGE`)
else
# Build using the system image on the CI
build_args = if get(ENV, "CI", "false") == "true"
# We probably should be using `CREATE_SYSIMG=true` to ensure faster starts on
# AWS Batch but currently that features is problematic on GitHub Actions:
# https://github.com/JuliaCloud/AWSClusterManagers.jl/issues/9
`--build-arg PKG_PRECOMPILE=true --build-arg CREATE_SYSIMG=false`
else
``
end
run(`docker build -t $TEST_IMAGE $build_args $PKG_DIR`)
end
# Push the image to ECR if the online tests require it. Note: `TEST_IMAGE` is required
# to be a full URI in order for the push operation to succeed.
if !isempty(intersect(ONLINE, ["batch", "batch-node"]))
Docker.push(TEST_IMAGE)
end
end
include("utils.jl")
@testset "AWSClusterManagers" begin
# Avoid accessing AWSCredentials in offline tests
withenv("AWS_ACCESS_KEY_ID" => "", "AWS_SECRET_ACCESS_KEY" => "") do
include("container.jl")
include("docker.jl")
include("batch.jl")
include("socket.jl")
include("batch_node.jl")
end
if "docker" in ONLINE
include("docker_online.jl")
else
warn(LOGGER) do
"Environment variable \"ONLINE\" does not contain \"docker\". " *
"Skipping online DockerManager tests."
end
end
if "batch" in ONLINE && !isempty(STACK_NAME)
include("batch_online.jl")
else
warn(LOGGER) do
"Environment variable \"ONLINE\" does not contain \"batch\". " *
"Skipping online AWSBatchManager tests."
end
end
if "batch-node" in ONLINE && !isempty(STACK_NAME)
include("batch_node_online.jl")
else
warn(LOGGER) do
"Environment variable \"ONLINE\" does not contain \"batch-node\". " *
"Skipping online AWSBatchNodeManager tests."
end
end
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 193 | @testset "get_interface_addrs" begin
results = AWSClusterManagers.get_interface_addrs()
@test results isa Vector{AWSClusterManagers.InterfaceAddress}
@test length(results) > 0
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | code | 3495 | # Gets the logs messages associated with a AWSBatch BatchJob as a single string
function log_messages(job::BatchJob; retries=5, wait_interval=7)
i = 0
events = log_events(job)
# Retry if no logs are found
while i < retries && (events === nothing || isempty(events))
i += 1
sleep(wait_interval)
events = log_events(job)
end
events === nothing && return ""
return join([string(event.timestamp, " ", event.message) for event in events], '\n')
end
function report(io::IO, job::BatchJob)
println(io, "Job ID: $(job.id)")
print(io, "Status: $(status(job))")
reason = status_reason(job)
reason !== nothing && print(io, " ($reason)")
println(io)
log_str = log_messages(job)
return !isempty(log_str) && println(io, '\n', log_str)
end
report(job::BatchJob) = sprint(report, job)
function job_duration(job::BatchJob)
d = describe(job)
if haskey(d, "createdAt") && haskey(d, "stoppedAt")
Millisecond(d["stoppedAt"] - d["createdAt"])
else
nothing
end
end
function job_runtime(job::BatchJob)
d = describe(job)
if haskey(d, "startedAt") && haskey(d, "stoppedAt")
Millisecond(d["stoppedAt"] - d["startedAt"])
else
nothing
end
end
function time_str(secs::Real)
@sprintf("%02d:%02d:%02d", div(secs, 3600), rem(div(secs, 60), 60), rem(secs, 60))
end
time_str(seconds::Second) = time_str(Dates.value(seconds))
time_str(p::Period) = time_str(floor(p, Second))
time_str(::Nothing) = "N/A" # Unable to determine duration
function register_job_definition(job_definition::AbstractDict)
output = Batch.register_job_definition(
job_definition["jobDefinitionName"], job_definition["type"], job_definition
)
return output["jobDefinitionArn"]
end
function submit_job(;
job_name::AbstractString,
job_definition::AbstractString,
job_queue::AbstractString=STACK["WorkerJobQueueArn"],
node_overrides::Dict=Dict(),
retry_strategy::Dict=Dict(),
)
options = Dict{String,Any}()
if !isempty(node_overrides)
options["nodeOverrides"] = node_overrides
end
if !isempty(retry_strategy)
options["retryStrategy"] = retry_strategy
end
print(JSON.json(options, 4))
output = Batch.submit_job(job_definition, job_name, job_queue, options)
return BatchJob(output["jobId"])
end
function describe_compute_environment(compute_environment::AbstractString)
# Equivalent to running the following on the AWS CLI
# ```
# aws batch describe-compute-environments
# --compute-environments $(STACK["ComputeEnvironmentArn"])
# --query computeEnvironments[0]
# ```
output = Batch.describe_compute_environments(
Dict("computeEnvironments" => [compute_environment])
)
details = if !isempty(output["computeEnvironments"])
output["computeEnvironments"][1]
else
nothing
end
return details
end
function wait_finish(job::BatchJob; timeout::Period=Minute(20))
timeout_secs = Dates.value(Second(timeout))
info(LOGGER, "Waiting for AWS Batch job to finish (~5 minutes)")
# TODO: Disable logging from wait? Or at least emit timestamps
wait(job, [AWSBatch.FAILED, AWSBatch.SUCCEEDED]; timeout=timeout_secs) # TODO: Support timeout as Period
duration = job_duration(job)
runtime = job_runtime(job)
info(LOGGER, "Job duration: $(time_str(duration)), Job runtime: $(time_str(runtime))")
return nothing
end
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | docs | 4058 | AWSClusterManagers
==================
[](https://github.com/JuliaCloud/AWSClusterManagers.jl/actions?query=workflow%3ACI)
[](https://app.bors.tech/repositories/32323)
[](https://github.com/invenia/BlueStyle)
[](https://codecov.io/gh/JuliaCloud/AWSClusterManagers.jl)
[](https://juliacloud.github.io/AWSClusterManagers.jl/stable)
Julia cluster managers which run within the AWS infrastructure.
## Installation
```julia
Pkg.add("AWSClusterManagers")
```
## Testing
Testing AWSClusterManagers can be performed on your local system using:
```julia
Pkg.test("AWSClusterManagers")
```
Adjustments can be made to the tests with the environmental variables `ONLINE` and
`STACK_NAME`:
- `ONLINE`: Should contain a comma separated list which contain elements from the set
"docker" and/or "batch". Including "docker" will run the online Docker tests (requires
[Docker](https://www.docker.com/community-edition) to be installed) and "batch" will run
AWS Batch tests (see `STACK_NAME` for details).
- `STACK_NAME`: Set the AWS Batch tests to use the stack specified. It is expected that
the stack already exists in the current AWS profile. Note that `STACK_NAME` is only
used if `ONLINE` contains "batch".
### Online Docker tests
To run the online Docker tests you'll need to have [Docker](https://www.docker.com/community-edition)
installed. Additionally you'll also need access to pull down the image
"468665244580.dkr.ecr.us-east-1.amazonaws.com/julia-baked" using your current AWS profile.
If your current profile doesn't have access then ask `@sudo` in [#techsupport](https://invenia.slack.com/messages/C02A3K084/)
to "Please grant account ID <ACCOUNT_ID> permissions to the [`julia-baked`](https://console.aws.amazon.com/ecs/home?region=us-east-1#/repositories/julia-baked#permissions) repo".
Make sure to replace `<ACCOUNT_ID>` with the results of `aws sts get-caller-identity --query Account`.
### Online AWS Batch tests
To run the online AWS Batch tests you need all of the requirements as specified in [Online Docker tests](#online-docker-tests),
the current AWS profile should have an aws-batch-manager-test stack running and
`STACK_NAME` needs to be set.
To make an aws-batch-manager-test compatible stack you can use the included CloudFormation
template [batch.yml](test/batch.yml). Alternatively you should be able to use your own
custom stack but it will be required to have, at a minimum, the named outputs as shown in the
included template.
## Sample Project Architecture
The details of how the AWSECSManager & AWSBatchManager will be described in more detail shortly, but we'll briefly summarizes a real world application archtecture using the AWSBatchManager.

The client machines on the left (e.g., your laptop) begin by pushing a docker image to ECR, registering a job definition, and submitting a cluster manager batch job.
The cluster manager job (JobID: 9086737) begins executing `julia demo.jl` which immediately submits 4 more batch jobs (JobIDs: 4636723, 3957289, 8650218 and 7931648) to function as its workers.
The manager then waits for the worker jobs to become available and register themselves with the manager.
Once the workers are available the remainder of the script sees them as ordinary julia worker processes (identified by the integer pid values shown in parentheses).
Finally, the batch manager exits, releasing all batch resources, and writing all STDOUT & STDERR to CloudWatch logs for the clients to view or download and saving an program results to S3.
The clients may then choose to view or download the logs/results at a later time.
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | docs | 2034 | AWSClusterManagers
==================
[](https://github.com/JuliaCloud/AWSClusterManagers.jl/actions?query=workflow%3ACI)
[](https://app.bors.tech/repositories/32323)
[](https://github.com/invenia/BlueStyle)
[](https://codecov.io/gh/JuliaCloud/AWSClusterManagers.jl)
[](https://juliacloud.github.io/AWSClusterManagers.jl/stable)
Julia cluster managers which run within the AWS infrastructure.
## Installation
```julia
Pkg.add("AWSClusterManagers")
```
## Sample Project Architecture
The details of how the AWSECSManager & AWSBatchManager will be described in more detail shortly, but we'll briefly summarizes a real world application archtecture using the AWSBatchManager.

The client machines on the left (e.g., your laptop) begin by pushing a docker image to ECR, registering a job definition, and submitting a cluster manager batch job.
The cluster manager job (JobID: 9086737) begins executing `julia demo.jl` which immediately submits 4 more batch jobs (JobIDs: 4636723, 3957289, 8650218 and 7931648) to function as its workers.
The manager then waits for the worker jobs to become available and register themselves with the manager.
Once the workers are available the remainder of the script sees them as ordinary julia worker processes (identified by the integer pid values shown in parentheses).
Finally, the batch manager exits, releasing all batch resources, and writing all STDOUT & STDERR to CloudWatch logs for the clients to view or download and saving an program results to S3.
The clients may then choose to view or download the logs/results at a later time.
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | docs | 582 | The SVG diagrams in this folder were created with [draw.io](https://www.draw.io/).
The saved XML files are included in case you need to modify the diagrams for any reason, but please ensure that you save and copy the XML file for the modified diagram along with the new SVG(s).
The diagrams exported with the `*-light` suffix are exported with "Transparent Background" enabled and "Dark" disabled.
The `*-dark` suffix diagrams are exported with "Transparent Background" enabled and "Dark" enabled.
Note that the "Dark" option only appears if you are using a dark theme in draw.io.
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | docs | 156 | # API
```@autodocs
Modules = [AWSClusterManagers]
Private = false
Pages = ["AWSClusterManagers.jl", "docker.jl", "batch.jl", "container.jl", "ecs.jl"]
```
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | docs | 5718 | # Batch
The AWSBatchManager allows you to use the [AWS Batch](https://aws.amazon.com/batch/) service
as a Julia cluster.
## Requirements
* An IAM role is setup that allows `batch:SubmitJob`, `batch:DescribeJobs`, and `batch:DescribeJobDefinitions`
* A Docker image registered with [AWS ECR](https://aws.amazon.com/ecr/) which has Julia
and AWSClusterManagers.jl installed.
The AWSBatchManager requires that the running AWS Batch jobs are run using
["networkMode=host"](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#network_mode)
which is the default for AWS Batch. This is only mentioned for completeness.
## Usage
Let's assume we want to run the following script:
```julia
# demo.jl
using AWSClusterManagers: AWSBatchManager
using Distributed
addprocs(AWSBatchManager(4))
println("Num Procs: ", nprocs())
@everywhere id = myid()
for i in workers()
println("Worker $i: ", remotecall_fetch(() -> id, i))
end
```
The workflow for deploying it on AWS Batch will be:
1. Build a docker container for your program.
2. Push the container to [ECR](https://aws.amazon.com/ecr/).
3. Register a new job definition which uses that container and specifies a command to run.
4. Submit a job to [Batch](https://aws.amazon.com/batch/).
### Overview

The client machines on the left (e.g., your laptop) begin by pushing a docker image to ECR, registering a job definition, and submitting a cluster manager batch job.
The cluster manager job (JobID: 9086737) begins executing `julia demo.jl` which immediately submits 4 more batch jobs (JobIDs: 4636723, 3957289, 8650218 and 7931648) to function as its workers.
The manager then waits for the worker jobs to become available and register themselves with the manager by executing `julia -e 'sock = connect(<manager_ip>, <manager_port>); Base.start_worker(sock, <cluster_cookie>)'` in identical containers.
Once the workers are available the remainder of the script sees them as ordinary julia worker processes (identified by the integer pid values shown in parentheses).
Finally, the batch manager exits, releasing all batch resources, and writing all STDOUT & STDERR to CloudWatch logs for the clients to view or download.
### Building the Docker Image
To begin we'll want to build a docker image which contains:
- `julia`
- `AWSClusterManagers`
- `demo.jl`
Example:
```
FROM julia:1.6
RUN julia -e 'using Pkg; Pkg.add("AWSClusterManagers")'
COPY demo.jl .
CMD ["julia demo.jl"]
```
Now build the docker file with:
```bash
docker build -t 000000000000.dkr.ecr.us-east-1.amazonaws.com/demo:latest .
```
### Pushing to ECR
Now we want to get our docker image on ECR.
Start by logging into the ECR service (this assumes your have `awscli` configured with the correct permissions):
```
$(aws ecr get-login --region us-east-1)
```
Now you should be able to push the image to ECR:
```bash
docker push 000000000000.dkr.ecr.us-east-1.amazonaws.com/demo:latest
```
### Registering a Job Definition
Let's register a job definition now.
**NOTE**: Registering a batch job requires the ECR image (see above) and an [IAM role](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) to apply to the job.
The AWSBatchManager requires that the IAM role have access to the following operations:
- `batch:SubmitJob`
- `batch:DescribeJobs`
- `batch:DescribeJobDefinitions`
Example)
```bash
aws batch register-job-definition --job-definition-name aws-batch-demo --type container --container-properties '
{
"image": "000000000000.dkr.ecr.us-east-1.amazonaws.com/demo:latest",
"vcpus": 1,
"memory": 1024,
"jobRoleArn": "arn:aws:iam::000000000000:role/AWSBatchClusterManagerJobRole",
"command": ["julia", "demo.jl"]
}'
```
**NOTE**: A job definition only needs to be registered once and can be
re-used for multiple job submissions.
### Submitting Jobs
Once the job definition has been registered we can then run the AWS Batch job.
In order to run a job you'll need to setup a compute environment with an associated a job queue:
```bash
aws batch submit-job --job-name aws-batch-demo --job-definition aws-batch-demo --job-queue aws-batch-queue
```
## Running AWSBatchManager Locally
While it is generally preferable to run the AWSBatchManager as a batch job, it can also be run locally.
In this case, worker batch jobs would be submitted from your local machine and would need to connect back to your machine from Amazon's network.
Unfortunately, this may result in networking bottlenecks if you're transferring large amounts of data between the manager (you local machine) and the workers (batch jobs).

As with the previous workflow, the client machine on the left begins by pushing a docker image to ECR (so the workers have access to the same code) and registers a job definition (if one doesn't already exist).
The client machine then runs `julia demo.jl` as the cluster manager which immediately submits 4 batch jobs (JobIDs: 4636723, 3957289, 8650218 and 7931648) to function as its workers.
The client machine waits for the worker machines to come online.
Once the workers are available the remainder of the script sees them as ordinary julia worker processes (identified by the integer pid values shown in parentheses) for the remainder of the program execution.
**NOTE**: Since the AWSBatchManager is not being run from within a batch job we need to give it some extra parameters when we create it.
```julia
mgr = AWSBatchManager(
4,
definition="aws-batch-worker",
name="aws-batch-worker",
queue="aws-batch-queue",
region="us-west-1",
timeout=5
)
```
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | docs | 2472 | # Design
A little background on the design of the ECSManager and why decisions were made the way
they were.
ECS is fundamentally a way of running Docker containers on EC2. It is quite possible that
multiple containers based upon the same image could be running on the same EC2 instance.
Since Julia uses TCP connections to talk between the various processes we need to be careful
not to use specific port to listen for connection as this would cause conflicts between
containers running on the same image. The solution to this problem is to use a "random" port
in the ephermal port range that is available.
Using an ephermal port solves the issue of running into port reservation conflicts but
introduces a new issue of having the port number on the newly spawned containers not being
deterministic by the process that launched them. Since Julia typically works by having the
manager connecting to the workers this is an issue. The solution implemented is to have the
manager open a port to listen to and then include the address and port of itself as part
of the task definition using [container overrides](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StartTask.html).
This way we can have the worker connect back to the manager.
Now Julia can use a variety of networking topologies (manager-to-worker or all-to-all).
In order to use as much of the built in code as possible we just have the worker report it's
address and port to the manager and then let the manager connect to the worker like in a
typical cluster manager.
## Networking Mode
The current implementation makes use of Docker "host" networking. This type of networking
means we are working directly with the instances network interface instead of having
a virtualized networking interface known as "bridge". The bridged networking is another way
of handling the port reservation problem but leads to other complications including not
knowning the address of the instance in which the container is running. Without that
information we cannot talk to containers running on separate instances.
Additionally, it has been stated that the "host" networking has [higher performance](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#network_mode)
and allows processes running within containers to reserve ports on the container host. Also,
this allows us to access the host instance metadata via `curl http://169.254.169.254/latest/meta-data/`.
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | docs | 2739 | # Docker
The DockerManager allows you to simulate a multi-machine julia cluster using Docker containers.
In the future, worker containers could be run across multiple hosts using [docker swarm](https://docs.docker.com/engine/swarm/), but this is currently not a supported configuration.
## Requirements
* [Docker](https://docs.docker.com/engine/installation/)
* A Docker image which has Julia, Docker andAWSClusterManagers.jl installed. A sample Dockerfile is provided in the root directory of this repository.
## Usage
In order to build the AWSClusterManagers docker container you should first build the
julia-baked:0.6 docker image (or pull it down from ECR).
More details on getting the julia-baked:0.6 image can be found in our [Dockerfiles repository](https://gitlab.invenia.ca/invenia/Dockerfiles/tree/master/julia-baked).
```bash
docker build -t aws-cluster-managers-test:latest .
# Optionally tag and push the image to ECR to share with others or for use with the AWSBatchManager.
$(aws ecr get-login --region us-east-1)
docker tag aws-cluster-managers-test:latest 468665244580.dkr.ecr.us-east-1.amazonaws.com/aws-cluster-managers-test:latest
docker push 468665244580.dkr.ecr.us-east-1.amazonaws.com/aws-cluster-managers-test:latest
```
## Overview

The client machine on the left (e.g., you laptop) begins by starting an interactive docker container using
the image "myproject".
```bash
docker run --network=host -v /var/run/docker.sock:/var/run/docker.sock --rm -it myproject:latest julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.0 (2017-06-19 13:05 UTC)
_/ |\__'_|_|_|\__'_| |
|__/ | x86_64-amazon-linux
julia>
```
**NOTE**: We need to use `--network=host -v /var/run/docker.sock:/var/run/docker.sock` in order for the docker container to bring up worker containers.
From here we can bring up worker machines and debug our multi-machine julia code.
```julia
julia> import AWSClusterManagers: DockerManager
julia> addprocs(DockerManager(4, "myproject:latest"))
4-element Array{Int64,1}:
2
3
4
5
julia> nprocs()
5
julia> for i in workers()
println("Worker $i: ", remotecall_fetch(() -> myid(), i))
end
Worker 2: 2
Worker 3: 3
Worker 4: 4
Worker 5: 5
```
## Running the DockerManager outside of a container
It's also possible to run the DockerManager outside of a container, so long as the host docker daemon is running and you're running the same version of julia (and packages) on the host.
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 1.2.0 | 461119b8565f8f75cea3882e0764913db42cffb6 | docs | 979 | # ECS (EC2 Container Service)
Meant for use within a ECS task which wants to spawn additional ECS tasks.
Requirements:
- Task definition uses networkMode "host"
- Security groups allow ECS cluster containers to talk to each other in the ephemeral port range
- Tasks have permission to execute "ecs:RunTask"
- Image which has julia, awscli, and this package installed
When a ECS task uses this manager there are several steps involved in setting up the new process. They are as follows:
1. Open a TCP server on a random port in the ephemeral range and start listening (manager)
2. Execute "ecs:RunTask" with a task defintion overrides which spawns julia and connects to the manager via TCP. Run the `start_worker` function which will send the workers address and port to the manager via the TCP socket.
3. The manager now knows the workers address and stops the TCP server.
4. Using the address of the worker the manager connects to the worker like a typical cluster manager.
| AWSClusterManagers | https://github.com/JuliaCloud/AWSClusterManagers.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | code | 2990 | module LightLearn
using Gtk
using Cairo
using ColorTypes:RGB24, RGB
using CommonMark
using Pkg
using PNGFiles
using PNGFiles.FixedPointNumbers:N0f8
using TOML
using Scratch
using Downloads
using JSON
using ZipFile
const LL_VERSION = v"3.0.0"
const DContext = Union{CairoContext, GraphicsContext}
export Cell, Space, Wall, NumCell
include("types.jl")
export Grid, Level, LevelSlot, Status
mutable struct Grid
data::Matrix{Cell}
end
Grid()=Grid(fill(Space(), 16, 16))
Base.getindex(g::Grid, x, y)=g.data[x, y]
function Base.setindex!(g::Grid, v::Cell, x, y)
g.data[x, y]=v
end
function clear!(g::Grid#=, x=16, y=16=#)
# if size(g, 1)<x
fill!(g.data, Space())
end
function Base.in(::Grid, x::Integer, y::Integer)
return 1<=x<=16 && 1<=y<=16
end
struct Level
initializer::Function
check::Function
end
struct LevelSlot
linkid::Int
title::String
end
function default_parser()
p=CommonMark.Parser()
enable!(p, AdmonitionRule())
return p
end
Base.@kwdef mutable struct Status
# control
formal::Bool = false
levels::Vector{Level} = Level[]
current::Int = 1
chapters::Vector{LevelSlot} = LevelSlot[]
# map
grids::Grid = Grid()
x::Int = 1
y::Int = 1
private::Dict = Dict{Symbol, Any}(:mdparser => default_parser())
# display
window::GtkWindow
canvas::GtkCanvas
context::Union{DContext, Nothing} = nothing
interval::Float64 = 0.5
imgcache::Dict{String, Matrix} = Dict{String, Matrix}()
end
function Base.show(io::IO, st::Status)
if st.formal
print(io, "<formal> ")
end
println(io, get_gtk_property(st.window, :title, String))
end
include("draw.jl")
export install_localzip, install_webzip, install_githubrepo, uninstall
include("install.jl")
export load_package, load_dir
include("data.jl")
export look, send
include("utils.jl")
export menu, level, rewind, submit
export north!, west!, east!, south!
include("control.jl")
# 沙盒
export sandbox, tp, getindex, setindex!
include("sandbox.jl")
export init, vis, quit
function init(loadstd::Bool=true) # __init__
st=Status(;
window=GtkWindow("LightLearn", 544, 528; resizable=false, visible=false),
canvas=GtkCanvas()
)
try
push!(st.window, st.canvas)
if loadstd
dir=getllpdir("Standard")
if !isfile(joinpath(dir, "Project.toml"))
install_githubrepo("JuliaRoadmap", "Standard.llp", "latest")
end
load_dir(st, dir)
end
init_canvas(st)
visible(st.window)
showall(st.window)
catch er
destroy(st.window)
throw(er)
end
return st
end
vis(st::Status, b::Bool)=visible(st.window::GtkWindow, b)
function init_canvas(st::Status)
# https://docs.gtk.org/gtk4/class.DrawingArea.html
@guarded draw(st.canvas) do _
st.context=getgc(st.canvas)
init_coord(st)
_draw(st)
end
end
function init_coord(st::Status)
ctx=st.context
set_source_rgb(ctx,0.75,0.75,0.75) # 背景填充
rectangle(ctx,0,0,544,528)
fill(ctx)
for i in 1:16
fill_text(st, "$i", 512, (i-1)<<5, 16, 16, 16)
fill_text(st, "$i", (i-1)<<5, 512, 16, 16, 16)
end
end
quit(st::Status)=destroy(st.window)
end
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | code | 1933 | function _draw(st::Status)
# ctx=getgc(canvas)
ctx=st.context
for i in 1:16
for j in 1:16
_show(st,
@inbounds(st.grids[i, j]),
(i-1)<<5,
(j-1)<<5
)
end
end
fill_image(st, "ply", st.x<<5-30, st.y<<5-30)
set_source_rgb(ctx,0.625,0.625,0.625)
for k in 1:16
rectangle(ctx,k<<5-1,0,1,512)
rectangle(ctx,0,k<<5-1,512,1)
end
fill(ctx)
end
function menu(st::Status)
for slot in st.chapters
println(slot.linkid, '\t', slot.title)
end
end
function initlevel(st::Status, lv::Level)
lv.initializer(st)
draw(st.canvas)
end
function level(st::Status, id::Integer, desc="#$id")
st.current=id
lv=st.levels[id]
set_gtk_property!(st.window, :title, "LightLearn: $desc")
initlevel(st, lv)
ev_enter(st, st.grids[st.x, st.y])
end
function level(st::Status, name::AbstractString)
for slot in st.chapters
if slot.title==name
st.current=slot.linkid
level(st, slot.linkid, slot.title)
break
end
end
end
function rewind(st::Status)
lv=st.levels[st.current]
initlevel(st, lv)
ev_enter(st, st.grids[st.x, st.y])
end
north!(st::Status)=move(st, 0, -1)
west!(st::Status)=move(st, -1, 0)
east!(st::Status)=move(st, 1, 0)
south!(st::Status)=move(st, 0, 1)
function move(st::Status, x::Int, y::Int)
tx=st.x+x
ty=st.y+y
grids=st.grids
if !in(grids, tx, ty) || @inbounds _solid(grids[tx, ty])
return
end
if st.x==tx && st.y==ty
@inbounds ev_stay(st, grids[tx, ty])
else
@inbounds ev_leave(st, grids[st.x, st.y])
st.x=tx
st.y=ty
@inbounds ev_enter(st, grids[tx, ty])
end
draw(st.canvas)
if st.formal
sleep(st.interval)
end
end
function submit(f, st::Status)
lv=st.levels[st.current]
initlevel(st, lv)
st.formal=true
try
ev_enter(st, st.grids[st.x, st.y])
f(st)
if !lv.check(st)
printstyled("未达成目标"; color=Base.default_color_warn)
return
end
printstyled("通过"; color=Base.default_color_info)
finally
st.formal=false
end
nothing # block display
end
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | code | 604 | function load_package(st::Status, s::AbstractString)
load_dir(st, getllpdir(s))
end
function load_dir(st::Status, s::AbstractString)
@info "$s"
setting=TOML.parsefile(joinpath(s, "Project.toml"))::Dict
chkcompat(setting["compat"]["LightLearn"])
mod=include(joinpath(s, "src/$(setting["name"]).jl"))
Base.invokelatest(mod.init, st)
applen=length(mod.levels)
orilen=length(st.levels)
fullen=applen+orilen
sizehint!(st.levels, fullen)
sizehint!(st.chapters, fullen)
for pair in mod.levels
orilen+=1
push!(st.levels, pair.second)
push!(st.chapters, LevelSlot(orilen, pair.first))
end
end
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | code | 972 | function load_imgsource(st::Status, name::String, path::String)
mat=PNGFiles.load(path)
tup=size(mat)
h=tup[1]
w=tup[2]
m2=Matrix{RGB24}(undef, w, h) # 列优先与行优先
for i in 1:h
for j in 1:w
m2[j, i]=RGB24(mat[i, j])
end
end
st.imgcache[name]=m2
end
function load_imgsources(st::Status)
vec=readdir(;sort=false)
for str in vec
name, _ = splitext(str)
load_imgsource(st, name, str)
end
end
function fill_image(st::Status, s::String, x::Integer, y::Integer)
ctx=st.context
if !haskey(st.imgcache, s)
@warn "未找到图像资源:$s"
set_source_rgb(ctx, 0.7, 0, 0)
rectangle(ctx, x, y, 16, 16)
return
end
img=st.imgcache[s]
sur=CairoImageSurface(img)
set_source_surface(ctx, sur, x, y)
paint(ctx)
end
function fill_text(st::Status,
text::String,
x::Int,
y::Int,
w::Int=32,
h::Int=32,
sz=div(w, textwidth(text)))
ctx=st.context
set_font_size(ctx, sz)
set_source_rgb(ctx, 0, 0, 0)
move_to(ctx, x, y+h) # show_text 从左下角开始
show_text(ctx, text)
end
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | code | 2308 | function getllpdir(name::AbstractString)
return joinpath(get_scratch!(@__MODULE__, "llp"), name)
end
function chkcompat(str::AbstractString)
ver=Pkg.Types.semver_spec(str)
if !(LL_VERSION in ver)
error("LightLearn 版本 $LL_VERSION 不符合要求 ($ver)")
end
end
function chkcompatmsg(str::AbstractString)
compat=findfirst(r"COMPAT=\".*\"", str)
if compat===nothing
error("发布信息中未找到符合格式的 COMPAT 数据")
end
return chkcompat(str[compat.start+8:compat.stop-1])
end
function uninstall(name::AbstractString)
rm(getllpdir(name))
end
function install_localzip(fpath::AbstractString; remove::Bool=false)
re=ZipFile.Reader(fpath)
fs=re.files
maindir=fs[1].name # 实践得出
len=length(maindir)
fnum=length(fs)
tomls=""
# 除去github自动生成的第一层目录包裹
for f in 2:fnum
fs[f].name=chop(fs[f].name;head=len,tail=0)
if fs[f].name=="Project.toml"
tomls=read(fs[f],String)
end
end
if tomls==""
error("未找到位于根的Project.toml")
end
toml=TOML.parse(tomls)
pname=toml["name"]
dir=getllpdir(pname)
mkpath(dir)
cd(dir)
@info "关卡包数据" toml["version"] toml["description"]
for f in 2:fnum
if iszero(fs[f].method)
mkpath(fs[f].name)
else
buf=readavailable(fs[f])
io=open(fs[f].name,"w")
write(io,ltoh(buf))
close(io)
end
end
io=open("Project.toml","w")
write(io,tomls)
close(io)
close(re)
if remove
rm(fpath)
end
end
function install_webzip(url::AbstractString)
fpath=joinpath(tempdir(), tempname())*"_llp.zip"
fio=open(fpath, "w")
Downloads.download(url, fio)
close(fio)
install_localzip(fpath)
end
function install_githubrepo(owner::AbstractString, repo::AbstractString, version::AbstractString="latest")
io=IOBuffer()
quest=request("https://api.github.com/repos/$owner/$repo/releases";method="GET",output=io)
if quest.status!=200
error("Github API 请求失败,status=$(quest.status)")
end
str=String(take!(io))
json=JSON.parse(str)
typeassert(json,Vector)
if version=="latest"
for d in json
@info "尝试:$(d["tag_name"])"
try
chkcompatmsg(d["body"])
install_webzip(d["zipball_url"])
return
catch er
if isa(er, ErrorException)
@warn er
else
throw(er)
end
end
end
else
for d in json
if d["tag_name"]==version
chkcompatmsg(d["body"])
install_webzip(d["zipball_url"])
end
end
@error "未找到标记为 $version 的发布"
end
end
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | code | 566 | struct Sandbox
ref::Status
end
function sandbox(st::Status)
set_gtk_property!(st.window, :title, "Sandbox")
st.x=1
st.y=1
draw(st.canvas)
return Sandbox(st)
end
function tp(sand::Sandbox, x::Integer, y::Integer)
st=sand.ref
chkin(st, x, y)
st.x=x
st.y=y
draw(st.canvas)
end
function Base.getindex(sand::Sandbox, x::Integer, y::Integer)
st=sand.ref
chkin(st, x, y)
@inbounds return st.grids[x, y]
end
function Base.setindex!(sand::Sandbox, v::Cell, x::Integer, y::Integer)
st=sand.ref
chkin(st, x, y)
@inbounds st.grids[x, y]=v
draw(st.canvas)
end
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | code | 627 | abstract type Cell end
# properties
_solid(::Cell)=false
_look(i::Cell)=i
_send(_, ::Cell, ::Val, args...)=nothing
# events
ev_enter(_, ::Cell)=nothing
ev_leave(_, ::Cell)=nothing
ev_stay(_, ::Cell)=nothing
ev_spawn(_, ::Cell)=nothing
ev_destroy(_, ::Cell)=nothing
### built-in cell types ###
struct Space<:Cell end
_show(_, ::Space, x, y)=nothing
struct Wall<:Cell end
_solid(::Wall)=true
function _show(st, ::Wall, x, y)
ctx=st.context
set_source_rgb(ctx, 0.5, 0.5, 0.5)
rectangle(ctx, x, y, 32, 32)
fill(ctx)
end
struct NumCell<:Cell
num::Number
end
_show(st, c::NumCell, x, y)=fill_text(st, string(c.num), x, y)
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | code | 487 | function chknear(st::Status, x::Int, y::Int)
if abs(x-st.x)+abs(y-st.y)>1
error("太远了")
end
end
function chkin(st::Status, x::Int, y::Int)
if !in(st.grids, x, y)
error("越界")
end
end
function look(st::Status, x::Int, y::Int)
chknear(st, x, y)
chkin(st, x, y)
@inbounds v=st.grids[x,y]
return _look(v)
end
function send(st::Status, method::Symbol, x::Int, y::Int, args...)
chknear(st, x, y)
chkin(st, x, y)
@inbounds return _send(st.grids[x, y], Val(method), args...)
end
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 3.0.0 | 13e1e908a0ba567d58208c577d2d4c6944deb498 | docs | 1600 | ## 用户手册
!!! note
如果您是使用者,请注意:调用本手册以外函数、修改源代码或关卡数据、在提交函数中包含错误的函数等行为均应视作作弊,但不被强制保证。
### 流程
使用 `st = init()` 创建一个游戏句柄,其中 `init` 接收一个参数,为 `false` 时不会导入 [`Standard.llp`](https://github.com/JuliaRoadmap/Standard.llp)。
在结束时,需注意调用 `quit(st)` 注销句柄。
使用 `menu`,你可以阅读已导入的关卡列表(包括整数 id 与 名称),可以通过 `level` 导入指定的关卡。可以进行手动尝试,但是正式提交需要调用 `submit(st)`,第二个参数接受一个函数,这个函数接受唯一参数是 `st::Status`。在此模式下,你可以调用:(以下函数第一个参数均为 `st::Status`)
* `north!`
* `west!`
* `east!`
* `south!`
* `look(st::Status, x::Int, y::Int)` 在「四相邻格」或本格时进行「观察」
* `send(st::Status, method::Symbol, x::Int, y::Int, args...)` 在「四相邻格」或本格时「发送数据」
### 沙盒模式
使用 `sand = sandbox(st)`,你可以创建一个沙盒。
在此模式下,可以调用 `tp(sand, x, y)`,`sand[x, y]`,`sand[x, y]=v`
### 导入
LightLearn 提供了两个导入函数:
* `load_package(st::Status, s::AbstractString)` 导入已安装的包,使用其名称
* `load_dir(st::Status, s::AbstractString)` 从本地指定目录导入
### 安装
LightLearn 提供了三个安装函数:
* `install_localzip(fpath::AbstractString; remove::Bool=false)` 从本地指定路径安装 zip
* `install_webzip(url::AbstractString)` 从网络指定 url 安装 zip
* `install_githubrepo(owner::AbstractString, repo::AbstractString, version::AbstractString="latest")` 从指定 github 仓库安装指定发布
同时,可以使用 `uninstall(name::AbstractString)` 去除安装
### 杂项
* 可以使用 `vis(st::Status, b::Bool)` 设置窗口可见性
## 开发者手册
[标准 Package 项目地址](https://github.com/JuliaRoadmap/Standard.llp)
目录下应包含以下文件
**Project.toml**
* `name` 当前关卡包名
* `uuid` 一个UUID
* `version` 当前版本
* `description` 介绍
* `[compat]` 其中 `"LightLearn"` 项表示接受的版本
**src/包名.jl**
* 返回值应为 `NamedTuple`
若要支持 `install_githubrepo` 方法,应在对应的 github 仓库发布 release,标注恰当的 tag(带`v`),在信息中必须含有字段`COMPAT="版本"`,与 `toml["compat"]["LightLearn"]` 统一
| LightLearn | https://github.com/Rratic/LightLearn.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 712 | using LibAwsSdkutils
using Documenter
DocMeta.setdocmeta!(LibAwsSdkutils, :DocTestSetup, :(using LibAwsSdkutils); recursive=true)
makedocs(;
modules=[LibAwsSdkutils],
repo="https://github.com/JuliaServices/LibAwsSdkutils.jl/blob/{commit}{path}#{line}",
sitename="LibAwsSdkutils.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://github.com/JuliaServices/LibAwsSdkutils.jl",
assets=String[],
size_threshold=2_000_000, # 2 MB, we generate about 1 MB page
size_threshold_warn=2_000_000,
),
pages=["Home" => "index.md"],
)
deploydocs(; repo="github.com/JuliaServices/LibAwsSdkutils.jl", devbranch="main")
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 3003 | using Clang.Generators
using Clang.JLLEnvs
using JLLPrefixes
import aws_c_common_jll, aws_c_sdkutils_jll
using LibAwsCommon
cd(@__DIR__)
# This is called if the docs generated from the extract_c_comment_style method did not generate any lines.
# We need to generate at least some docs so that cross-references work with Documenter.jl.
function get_docs(node, docs)
# The macro node types (except for MacroDefault) seem to not generate code, but they will still emit docs and then
# you end up with docs stacked on top of each other, which is a Julia LoadError.
if node.type isa Generators.AbstractMacroNodeType && !(node.type isa Generators.MacroDefault)
return String[]
end
# don't generate empty docs because it makes Documenter.jl mad
if isempty(docs)
return ["Documentation not found."]
end
return docs
end
function should_skip_target(target)
# aws_c_common_jll does not support i686 windows https://github.com/JuliaPackaging/Yggdrasil/blob/bbab3a916ae5543902b025a4a873cf9ee4a7de68/A/aws_c_common/build_tarballs.jl#L48-L49
return target == "i686-w64-mingw32"
end
const deps_jlls = [aws_c_common_jll]
const deps = [LibAwsCommon]
const deps_names = sort(collect(Iterators.flatten(names.(deps))))
# clang can emit code for forward declarations of structs defined in our dependencies. we need to skip those, otherwise
# we'll have duplicate struct definitions.
function skip_nodes_in_dependencies!(dag::ExprDAG)
replace!(get_nodes(dag)) do node
if insorted(node.id, deps_names)
return ExprNode(node.id, Generators.Skip(), node.cursor, Expr[], node.adj)
end
return node
end
end
# download toolchains in parallel
Threads.@threads for target in JLLEnvs.JLL_ENV_TRIPLES
if should_skip_target(target)
continue
end
get_default_args(target) # downloads the toolchain
end
for target in JLLEnvs.JLL_ENV_TRIPLES
if should_skip_target(target)
continue
end
options = load_options(joinpath(@__DIR__, "generator.toml"))
options["general"]["output_file_path"] = joinpath(@__DIR__, "..", "lib", "$target.jl")
options["general"]["callback_documentation"] = get_docs
args = get_default_args(target)
for dep in deps_jlls
inc = JLLEnvs.get_pkg_include_dir(dep, target)
push!(args, "-isystem$inc")
end
header_dirs = []
inc = JLLEnvs.get_pkg_include_dir(aws_c_sdkutils_jll, target)
push!(args, "-I$inc")
push!(header_dirs, inc)
headers = String[]
for header_dir in header_dirs
for (root, dirs, files) in walkdir(header_dir)
for file in files
if endswith(file, ".h")
push!(headers, joinpath(root, file))
end
end
end
end
unique!(headers)
ctx = create_context(headers, args, options)
build!(ctx, BUILDSTAGE_NO_PRINTING)
skip_nodes_in_dependencies!(ctx.dag)
build!(ctx, BUILDSTAGE_PRINTING_ONLY)
end
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 32312 | using CEnum
"""
Documentation not found.
"""
mutable struct aws_profile_property end
"""
Documentation not found.
"""
mutable struct aws_profile end
"""
Documentation not found.
"""
mutable struct aws_profile_collection end
"""
aws_profile_source_type
The profile specification has rule exceptions based on what file the profile collection comes from.
"""
@cenum aws_profile_source_type::UInt32 begin
AWS_PST_NONE = 0
AWS_PST_CONFIG = 1
AWS_PST_CREDENTIALS = 2
end
"""
aws_profile_section_type
Documentation not found.
"""
@cenum aws_profile_section_type::UInt32 begin
AWS_PROFILE_SECTION_TYPE_PROFILE = 0
AWS_PROFILE_SECTION_TYPE_SSO_SESSION = 1
AWS_PROFILE_SECTION_TYPE_COUNT = 2
end
"""
aws_profile_collection_acquire(collection)
Increments the reference count on the profile collection, allowing the caller to take a reference to it.
Returns the same profile collection passed in.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_acquire(collection)
ccall((:aws_profile_collection_acquire, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_release(collection)
Decrements a profile collection's ref count. When the ref count drops to zero, the collection will be destroyed. Returns NULL.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection);
```
"""
function aws_profile_collection_release(collection)
ccall((:aws_profile_collection_release, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_profile_collection},), collection)
end
"""
aws_profile_collection_destroy(profile_collection)
!!! compat "Deprecated"
This is equivalent to [`aws_profile_collection_release`](@ref).
### Prototype
```c
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_destroy(profile_collection)
ccall((:aws_profile_collection_destroy, libaws_c_sdkutils), Cvoid, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_new_from_file(allocator, file_path, source)
Create a new profile collection by parsing a file with the specified path
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_file( struct aws_allocator *allocator, const struct aws_string *file_path, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_file(allocator, file_path, source)
ccall((:aws_profile_collection_new_from_file, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_string}, aws_profile_source_type), allocator, file_path, source)
end
"""
aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
Create a new profile collection by merging a config-file-based profile collection and a credentials-file-based profile collection
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_merge( struct aws_allocator *allocator, const struct aws_profile_collection *config_profiles, const struct aws_profile_collection *credentials_profiles);
```
"""
function aws_profile_collection_new_from_merge(allocator, config_profiles, credentials_profiles)
ccall((:aws_profile_collection_new_from_merge, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_profile_collection}, Ptr{aws_profile_collection}), allocator, config_profiles, credentials_profiles)
end
"""
aws_profile_collection_new_from_buffer(allocator, buffer, source)
Create a new profile collection by parsing text in a buffer. Primarily for testing.
### Prototype
```c
struct aws_profile_collection *aws_profile_collection_new_from_buffer( struct aws_allocator *allocator, const struct aws_byte_buf *buffer, enum aws_profile_source_type source);
```
"""
function aws_profile_collection_new_from_buffer(allocator, buffer, source)
ccall((:aws_profile_collection_new_from_buffer, libaws_c_sdkutils), Ptr{aws_profile_collection}, (Ptr{aws_allocator}, Ptr{aws_byte_buf}, aws_profile_source_type), allocator, buffer, source)
end
"""
aws_profile_collection_get_profile(profile_collection, profile_name)
Retrieves a reference to a profile with the specified name, if it exists, from the profile collection
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_profile( const struct aws_profile_collection *profile_collection, const struct aws_string *profile_name);
```
"""
function aws_profile_collection_get_profile(profile_collection, profile_name)
ccall((:aws_profile_collection_get_profile, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, Ptr{aws_string}), profile_collection, profile_name)
end
"""
aws_profile_collection_get_section(profile_collection, section_type, section_name)
Documentation not found.
### Prototype
```c
const struct aws_profile *aws_profile_collection_get_section( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type, const struct aws_string *section_name);
```
"""
function aws_profile_collection_get_section(profile_collection, section_type, section_name)
ccall((:aws_profile_collection_get_section, libaws_c_sdkutils), Ptr{aws_profile}, (Ptr{aws_profile_collection}, aws_profile_section_type, Ptr{aws_string}), profile_collection, section_type, section_name)
end
"""
aws_profile_collection_get_profile_count(profile_collection)
Returns the number of profiles in a collection
### Prototype
```c
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection);
```
"""
function aws_profile_collection_get_profile_count(profile_collection)
ccall((:aws_profile_collection_get_profile_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection},), profile_collection)
end
"""
aws_profile_collection_get_section_count(profile_collection, section_type)
Returns the number of elements of the specified section in a collection.
### Prototype
```c
size_t aws_profile_collection_get_section_count( const struct aws_profile_collection *profile_collection, const enum aws_profile_section_type section_type);
```
"""
function aws_profile_collection_get_section_count(profile_collection, section_type)
ccall((:aws_profile_collection_get_section_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_collection}, aws_profile_section_type), profile_collection, section_type)
end
"""
aws_profile_get_name(profile)
Returns a reference to the name of the provided profile
### Prototype
```c
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile);
```
"""
function aws_profile_get_name(profile)
ccall((:aws_profile_get_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile},), profile)
end
"""
aws_profile_get_property(profile, property_name)
Retrieves a reference to a property with the specified name, if it exists, from a profile
### Prototype
```c
const struct aws_profile_property *aws_profile_get_property( const struct aws_profile *profile, const struct aws_string *property_name);
```
"""
function aws_profile_get_property(profile, property_name)
ccall((:aws_profile_get_property, libaws_c_sdkutils), Ptr{aws_profile_property}, (Ptr{aws_profile}, Ptr{aws_string}), profile, property_name)
end
"""
aws_profile_get_property_count(profile)
Returns how many properties a profile holds
### Prototype
```c
size_t aws_profile_get_property_count(const struct aws_profile *profile);
```
"""
function aws_profile_get_property_count(profile)
ccall((:aws_profile_get_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile},), profile)
end
"""
aws_profile_property_get_value(property)
Returns a reference to the property's string value
### Prototype
```c
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_value(property)
ccall((:aws_profile_property_get_value, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property},), property)
end
"""
aws_profile_property_get_sub_property(property, sub_property_name)
Returns a reference to the value of a sub property with the given name, if it exists, in the property
### Prototype
```c
const struct aws_string *aws_profile_property_get_sub_property( const struct aws_profile_property *property, const struct aws_string *sub_property_name);
```
"""
function aws_profile_property_get_sub_property(property, sub_property_name)
ccall((:aws_profile_property_get_sub_property, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_profile_property}, Ptr{aws_string}), property, sub_property_name)
end
"""
aws_profile_property_get_sub_property_count(property)
Returns how many sub properties the property holds
### Prototype
```c
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property);
```
"""
function aws_profile_property_get_sub_property_count(property)
ccall((:aws_profile_property_get_sub_property_count, libaws_c_sdkutils), Csize_t, (Ptr{aws_profile_property},), property)
end
"""
aws_get_credentials_file_path(allocator, override_path)
Computes the final platform-specific path for the profile credentials file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_credentials_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_credentials_file_path(allocator, override_path)
ccall((:aws_get_credentials_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_config_file_path(allocator, override_path)
Computes the final platform-specific path for the profile config file. Does limited home directory expansion/resolution.
override\\_path, if not null, will be searched first instead of using the standard home directory config path
### Prototype
```c
struct aws_string *aws_get_config_file_path( struct aws_allocator *allocator, const struct aws_byte_cursor *override_path);
```
"""
function aws_get_config_file_path(allocator, override_path)
ccall((:aws_get_config_file_path, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_path)
end
"""
aws_get_profile_name(allocator, override_name)
Computes the profile to use for credentials lookups based on profile resolution rules
### Prototype
```c
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name);
```
"""
function aws_get_profile_name(allocator, override_name)
ccall((:aws_get_profile_name, libaws_c_sdkutils), Ptr{aws_string}, (Ptr{aws_allocator}, Ptr{aws_byte_cursor}), allocator, override_name)
end
"""
Documentation not found.
"""
mutable struct aws_endpoints_ruleset end
"""
Documentation not found.
"""
mutable struct aws_partitions_config end
"""
Documentation not found.
"""
mutable struct aws_endpoints_parameter end
"""
Documentation not found.
"""
mutable struct aws_endpoints_rule_engine end
"""
Documentation not found.
"""
mutable struct aws_endpoints_resolved_endpoint end
"""
Documentation not found.
"""
mutable struct aws_endpoints_request_context end
"""
aws_endpoints_parameter_type
Documentation not found.
"""
@cenum aws_endpoints_parameter_type::UInt32 begin
AWS_ENDPOINTS_PARAMETER_STRING = 0
AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1
end
"""
aws_endpoints_resolved_endpoint_type
Documentation not found.
"""
@cenum aws_endpoints_resolved_endpoint_type::UInt32 begin
AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0
AWS_ENDPOINTS_RESOLVED_ERROR = 1
end
"""
aws_endpoints_get_supported_ruleset_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void);
```
"""
function aws_endpoints_get_supported_ruleset_version()
ccall((:aws_endpoints_get_supported_ruleset_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_endpoints_parameter_get_type(parameter)
Documentation not found.
### Prototype
```c
enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_type(parameter)
ccall((:aws_endpoints_parameter_get_type, libaws_c_sdkutils), aws_endpoints_parameter_type, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_built_in(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_built_in( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_built_in(parameter)
ccall((:aws_endpoints_parameter_get_built_in, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_default_string(parameter, out_cursor)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_string( const struct aws_endpoints_parameter *parameter, struct aws_byte_cursor *out_cursor);
```
"""
function aws_endpoints_parameter_get_default_string(parameter, out_cursor)
ccall((:aws_endpoints_parameter_get_default_string, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{aws_byte_cursor}), parameter, out_cursor)
end
"""
aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
Documentation not found.
### Prototype
```c
int aws_endpoints_parameter_get_default_boolean( const struct aws_endpoints_parameter *parameter, const bool **out_bool);
```
"""
function aws_endpoints_parameter_get_default_boolean(parameter, out_bool)
ccall((:aws_endpoints_parameter_get_default_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_parameter}, Ptr{Ptr{Bool}}), parameter, out_bool)
end
"""
aws_endpoints_parameter_get_is_required(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_is_required(parameter)
ccall((:aws_endpoints_parameter_get_is_required, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_documentation(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_documentation( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_documentation(parameter)
ccall((:aws_endpoints_parameter_get_documentation, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameters_get_is_deprecated(parameter)
Documentation not found.
### Prototype
```c
bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameters_get_is_deprecated(parameter)
ccall((:aws_endpoints_parameters_get_is_deprecated, libaws_c_sdkutils), Bool, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_message(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_message(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_message, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_parameter_get_deprecated_since(parameter)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( const struct aws_endpoints_parameter *parameter);
```
"""
function aws_endpoints_parameter_get_deprecated_since(parameter)
ccall((:aws_endpoints_parameter_get_deprecated_since, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_parameter},), parameter)
end
"""
aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor ruleset_json);
```
"""
function aws_endpoints_ruleset_new_from_string(allocator, ruleset_json)
ccall((:aws_endpoints_ruleset_new_from_string, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, ruleset_json)
end
"""
aws_endpoints_ruleset_acquire(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_acquire(ruleset)
ccall((:aws_endpoints_ruleset_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_release(ruleset)
Documentation not found.
### Prototype
```c
struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_release(ruleset)
ccall((:aws_endpoints_ruleset_release, libaws_c_sdkutils), Ptr{aws_endpoints_ruleset}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_parameters(ruleset)
Documentation not found.
### Prototype
```c
const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_parameters(ruleset)
ccall((:aws_endpoints_ruleset_get_parameters, libaws_c_sdkutils), Ptr{aws_hash_table}, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_version(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_version(ruleset)
ccall((:aws_endpoints_ruleset_get_version, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_ruleset_get_service_id(ruleset)
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( const struct aws_endpoints_ruleset *ruleset);
```
"""
function aws_endpoints_ruleset_get_service_id(ruleset)
ccall((:aws_endpoints_ruleset_get_service_id, libaws_c_sdkutils), aws_byte_cursor, (Ptr{aws_endpoints_ruleset},), ruleset)
end
"""
aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
Create new rule engine for a given ruleset. In cases of failure NULL is returned and last error is set.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( struct aws_allocator *allocator, struct aws_endpoints_ruleset *ruleset, struct aws_partitions_config *partitions_config);
```
"""
function aws_endpoints_rule_engine_new(allocator, ruleset, partitions_config)
ccall((:aws_endpoints_rule_engine_new, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_allocator}, Ptr{aws_endpoints_ruleset}, Ptr{aws_partitions_config}), allocator, ruleset, partitions_config)
end
"""
aws_endpoints_rule_engine_acquire(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_acquire(rule_engine)
ccall((:aws_endpoints_rule_engine_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_rule_engine_release(rule_engine)
Documentation not found.
### Prototype
```c
struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( struct aws_endpoints_rule_engine *rule_engine);
```
"""
function aws_endpoints_rule_engine_release(rule_engine)
ccall((:aws_endpoints_rule_engine_release, libaws_c_sdkutils), Ptr{aws_endpoints_rule_engine}, (Ptr{aws_endpoints_rule_engine},), rule_engine)
end
"""
aws_endpoints_request_context_new(allocator)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_new( struct aws_allocator *allocator);
```
"""
function aws_endpoints_request_context_new(allocator)
ccall((:aws_endpoints_request_context_new, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_allocator},), allocator)
end
"""
aws_endpoints_request_context_acquire(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_acquire(request_context)
ccall((:aws_endpoints_request_context_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_release(request_context)
Documentation not found.
### Prototype
```c
struct aws_endpoints_request_context *aws_endpoints_request_context_release( struct aws_endpoints_request_context *request_context);
```
"""
function aws_endpoints_request_context_release(request_context)
ccall((:aws_endpoints_request_context_release, libaws_c_sdkutils), Ptr{aws_endpoints_request_context}, (Ptr{aws_endpoints_request_context},), request_context)
end
"""
aws_endpoints_request_context_add_string(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_string( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, struct aws_byte_cursor value);
```
"""
function aws_endpoints_request_context_add_string(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_string, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, aws_byte_cursor), allocator, context, name, value)
end
"""
aws_endpoints_request_context_add_boolean(allocator, context, name, value)
Documentation not found.
### Prototype
```c
int aws_endpoints_request_context_add_boolean( struct aws_allocator *allocator, struct aws_endpoints_request_context *context, struct aws_byte_cursor name, bool value);
```
"""
function aws_endpoints_request_context_add_boolean(allocator, context, name, value)
ccall((:aws_endpoints_request_context_add_boolean, libaws_c_sdkutils), Cint, (Ptr{aws_allocator}, Ptr{aws_endpoints_request_context}, aws_byte_cursor, Bool), allocator, context, name, value)
end
"""
aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
Documentation not found.
### Prototype
```c
int aws_endpoints_rule_engine_resolve( struct aws_endpoints_rule_engine *engine, const struct aws_endpoints_request_context *context, struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
```
"""
function aws_endpoints_rule_engine_resolve(engine, context, out_resolved_endpoint)
ccall((:aws_endpoints_rule_engine_resolve, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_rule_engine}, Ptr{aws_endpoints_request_context}, Ptr{Ptr{aws_endpoints_resolved_endpoint}}), engine, context, out_resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_acquire(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_acquire, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_release(resolved_endpoint)
Documentation not found.
### Prototype
```c
struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_release(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_release, libaws_c_sdkutils), Ptr{aws_endpoints_resolved_endpoint}, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
Documentation not found.
### Prototype
```c
enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( const struct aws_endpoints_resolved_endpoint *resolved_endpoint);
```
"""
function aws_endpoints_resolved_endpoint_get_type(resolved_endpoint)
ccall((:aws_endpoints_resolved_endpoint_get_type, libaws_c_sdkutils), aws_endpoints_resolved_endpoint_type, (Ptr{aws_endpoints_resolved_endpoint},), resolved_endpoint)
end
"""
aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_url( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_url);
```
"""
function aws_endpoints_resolved_endpoint_get_url(resolved_endpoint, out_url)
ccall((:aws_endpoints_resolved_endpoint_get_url, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_url)
end
"""
aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_properties( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_properties);
```
"""
function aws_endpoints_resolved_endpoint_get_properties(resolved_endpoint, out_properties)
ccall((:aws_endpoints_resolved_endpoint_get_properties, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_properties)
end
"""
aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_headers( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, const struct aws_hash_table **out_headers);
```
"""
function aws_endpoints_resolved_endpoint_get_headers(resolved_endpoint, out_headers)
ccall((:aws_endpoints_resolved_endpoint_get_headers, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{Ptr{aws_hash_table}}), resolved_endpoint, out_headers)
end
"""
aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
Documentation not found.
### Prototype
```c
int aws_endpoints_resolved_endpoint_get_error( const struct aws_endpoints_resolved_endpoint *resolved_endpoint, struct aws_byte_cursor *out_error);
```
"""
function aws_endpoints_resolved_endpoint_get_error(resolved_endpoint, out_error)
ccall((:aws_endpoints_resolved_endpoint_get_error, libaws_c_sdkutils), Cint, (Ptr{aws_endpoints_resolved_endpoint}, Ptr{aws_byte_cursor}), resolved_endpoint, out_error)
end
"""
aws_partitions_get_supported_version()
Documentation not found.
### Prototype
```c
struct aws_byte_cursor aws_partitions_get_supported_version(void);
```
"""
function aws_partitions_get_supported_version()
ccall((:aws_partitions_get_supported_version, libaws_c_sdkutils), aws_byte_cursor, ())
end
"""
aws_partitions_config_new_from_string(allocator, json)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_new_from_string( struct aws_allocator *allocator, struct aws_byte_cursor json);
```
"""
function aws_partitions_config_new_from_string(allocator, json)
ccall((:aws_partitions_config_new_from_string, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, json)
end
"""
aws_partitions_config_acquire(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_acquire(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_acquire(partitions)
ccall((:aws_partitions_config_acquire, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_partitions_config_release(partitions)
Documentation not found.
### Prototype
```c
struct aws_partitions_config *aws_partitions_config_release(struct aws_partitions_config *partitions);
```
"""
function aws_partitions_config_release(partitions)
ccall((:aws_partitions_config_release, libaws_c_sdkutils), Ptr{aws_partitions_config}, (Ptr{aws_partitions_config},), partitions)
end
"""
aws_resource_name
Documentation not found.
"""
struct aws_resource_name
partition::aws_byte_cursor
service::aws_byte_cursor
region::aws_byte_cursor
account_id::aws_byte_cursor
resource_id::aws_byte_cursor
end
"""
aws_resource_name_init_from_cur(arn, input)
Given an ARN "Amazon Resource Name" represented as an in memory a structure representing the parts
### Prototype
```c
int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
```
"""
function aws_resource_name_init_from_cur(arn, input)
ccall((:aws_resource_name_init_from_cur, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{aws_byte_cursor}), arn, input)
end
"""
aws_resource_name_length(arn, size)
Calculates the space needed to write an ARN to a byte buf
### Prototype
```c
int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
```
"""
function aws_resource_name_length(arn, size)
ccall((:aws_resource_name_length, libaws_c_sdkutils), Cint, (Ptr{aws_resource_name}, Ptr{Csize_t}), arn, size)
end
"""
aws_byte_buf_append_resource_name(buf, arn)
Serializes an ARN structure into the lexical string format
### Prototype
```c
int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
```
"""
function aws_byte_buf_append_resource_name(buf, arn)
ccall((:aws_byte_buf_append_resource_name, libaws_c_sdkutils), Cint, (Ptr{aws_byte_buf}, Ptr{aws_resource_name}), buf, arn)
end
"""
aws_sdkutils_errors
Documentation not found.
"""
@cenum aws_sdkutils_errors::UInt32 begin
AWS_ERROR_SDKUTILS_GENERAL = 15360
AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361
AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363
AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365
AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366
AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367
AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368
AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369
AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370
AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_REGEX = 15371
AWS_ERROR_SDKUTILS_ENDPOINTS_REGEX_NO_MATCH = 15372
AWS_ERROR_SDKUTILS_END_RANGE = 16383
end
"""
aws_sdkutils_log_subject
Documentation not found.
"""
@cenum aws_sdkutils_log_subject::UInt32 begin
AWS_LS_SDKUTILS_GENERAL = 15360
AWS_LS_SDKUTILS_PROFILE = 15361
AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362
AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363
AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364
AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365
AWS_LS_SDKUTILS_ENDPOINTS_REGEX = 15366
AWS_LS_SDKUTILS_LAST = 16383
end
"""
aws_sdkutils_library_init(allocator)
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_init(struct aws_allocator *allocator);
```
"""
function aws_sdkutils_library_init(allocator)
ccall((:aws_sdkutils_library_init, libaws_c_sdkutils), Cvoid, (Ptr{aws_allocator},), allocator)
end
"""
aws_sdkutils_library_clean_up()
Documentation not found.
### Prototype
```c
void aws_sdkutils_library_clean_up(void);
```
"""
function aws_sdkutils_library_clean_up()
ccall((:aws_sdkutils_library_clean_up, libaws_c_sdkutils), Cvoid, ())
end
"""
Documentation not found.
"""
const AWS_C_SDKUTILS_PACKAGE_ID = 15
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 2072 | module LibAwsSdkutils
using aws_c_sdkutils_jll
using LibAwsCommon
const IS_LIBC_MUSL = occursin("musl", Base.BUILD_TRIPLET)
if Sys.isapple() && Sys.ARCH === :aarch64
include("../lib/aarch64-apple-darwin20.jl")
elseif Sys.islinux() && Sys.ARCH === :aarch64 && !IS_LIBC_MUSL
include("../lib/aarch64-linux-gnu.jl")
elseif Sys.islinux() && Sys.ARCH === :aarch64 && IS_LIBC_MUSL
include("../lib/aarch64-linux-musl.jl")
elseif Sys.islinux() && startswith(string(Sys.ARCH), "arm") && !IS_LIBC_MUSL
include("../lib/armv7l-linux-gnueabihf.jl")
elseif Sys.islinux() && startswith(string(Sys.ARCH), "arm") && IS_LIBC_MUSL
include("../lib/armv7l-linux-musleabihf.jl")
elseif Sys.islinux() && Sys.ARCH === :i686 && !IS_LIBC_MUSL
include("../lib/i686-linux-gnu.jl")
elseif Sys.islinux() && Sys.ARCH === :i686 && IS_LIBC_MUSL
include("../lib/i686-linux-musl.jl")
elseif Sys.iswindows() && Sys.ARCH === :i686
error("LibAwsCommon.jl does not support i686 windows https://github.com/JuliaPackaging/Yggdrasil/blob/bbab3a916ae5543902b025a4a873cf9ee4a7de68/A/aws_c_common/build_tarballs.jl#L48-L49")
elseif Sys.islinux() && Sys.ARCH === :powerpc64le
include("../lib/powerpc64le-linux-gnu.jl")
elseif Sys.isapple() && Sys.ARCH === :x86_64
include("../lib/x86_64-apple-darwin14.jl")
elseif Sys.islinux() && Sys.ARCH === :x86_64 && !IS_LIBC_MUSL
include("../lib/x86_64-linux-gnu.jl")
elseif Sys.islinux() && Sys.ARCH === :x86_64 && IS_LIBC_MUSL
include("../lib/x86_64-linux-musl.jl")
elseif Sys.isbsd() && !Sys.isapple()
include("../lib/x86_64-unknown-freebsd13.2.jl")
elseif Sys.iswindows() && Sys.ARCH === :x86_64
include("../lib/x86_64-w64-mingw32.jl")
else
error("Unknown platform: $(Base.BUILD_TRIPLET)")
end
# exports
for name in names(@__MODULE__; all=true)
if name == :eval || name == :include || contains(string(name), "#")
continue
end
@eval export $name
end
function init(allocator=default_aws_allocator())
LibAwsCommon.init(allocator)
aws_sdkutils_library_init(allocator)
return
end
end
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | code | 487 | using Test, Aqua, LibAwsSdkutils, LibAwsCommon
@testset "LibAwsSdkutils" begin
@testset "aqua" begin
Aqua.test_all(LibAwsSdkutils, ambiguities=false)
Aqua.test_ambiguities(LibAwsSdkutils)
end
@testset "basic usage to test the library loads" begin
alloc = aws_default_allocator() # important! this shouldn't need to be qualified! if we generate a definition for it in LibAwsSdkutils that is a bug.
aws_sdkutils_library_init(alloc)
end
end
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | docs | 510 | [](https://JuliaServices.github.io/LibAwsSdkutils.jl/stable)
[](https://JuliaServices.github.io/LibAwsSdkutils.jl/dev)
[](https://github.com/JuliaServices/LibAwsSdkutils.jl/actions/workflows/ci.yml)
# LibAwsSdkutils.jl
Julia bindings for the [aws-c-sdkutils](https://github.com/awslabs/aws-c-sdkutils) library.
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 1.1.0 | e8dfb8e32cffd3f065b5e8179889a8dead573cf6 | docs | 211 | ```@meta
CurrentModule = LibAwsSdkutils
```
# LibAwsSdkutils
Documentation for [LibAwsSdkutils](https://github.com/JuliaServices/LibAwsSdkutils.jl).
```@index
```
```@autodocs
Modules = [LibAwsSdkutils]
```
| LibAwsSdkutils | https://github.com/JuliaServices/LibAwsSdkutils.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 5987 | # Based on documentation of DFTK
using LibGit2: LibGit2
using Pkg: Pkg
# To manually generate the docs:
#
# 1. Install all python dependencies from the PYDEPS array below.
# 2. Run "julia make.jl" to generate the docs
# Set to true to disable some checks and cleanup
DEBUG = true
# Where to get files from and where to build them
SRCPATH = joinpath(@__DIR__, "src")
BUILDPATH = joinpath(@__DIR__, "build")
ROOTPATH = joinpath(@__DIR__, "..")
CONTINUOUS_INTEGRATION = get(ENV, "CI", nothing) == "true"
# Python and Julia dependencies needed for running the notebooks
# PYDEPS = ["ase", "pymatgen"]
JLDEPS = [Pkg.PackageSpec(; url = "https://github.com/louisponet/DFWannier.jl.git",
rev = LibGit2.head(ROOTPATH))]
# Setup julia dependencies for docs generation if not yet done
Pkg.activate(@__DIR__)
# if !isfile(joinpath(@__DIR__, "Manifest.toml"))
# Pkg.develop(Pkg.PackageSpec(; path = ROOTPATH))
# Pkg.instantiate()
# Pkg.add(; url = "https://github.com/kimikage/Documenter.jl", rev = "ansicolor")
# end
# Setup environment for making plots
ENV["GKS_ENCODING"] = "utf8"
ENV["GKSwstype"] = "100"
ENV["PLOTS_TEST"] = "true"
# Import packages for docs generation
using UUIDs
using DFWannier
using Documenter
using Literate
# Collect examples from the example index (src/index.md)
# The chosen examples are taken from the examples/ folder to be processed by Literate
EXAMPLES = [String(m[1])
for m in
match.(r"\"(examples/[^\"]+.md)\"",
readlines(joinpath(SRCPATH, "index.md"))) if !isnothing(m)]
# Collect files to treat with Literate (i.e. the examples and the .jl files in the docs)
# The examples go to docs/literate_build/examples, the .jl files stay where they are
literate_files = NamedTuple{(:src, :dest, :example),Tuple{String,String,Bool}}[(src = joinpath(ROOTPATH,
splitext(file)[1] *
".jl"),
dest = joinpath(SRCPATH,
"examples"),
example = true)
for file in
EXAMPLES]
for (dir, directories, files) in walkdir(SRCPATH)
for file in files
if endswith(file, ".jl")
push!(literate_files, (src = joinpath(dir, file), dest = dir, example = false))
end
end
end
# Run Literate on them all
for file in literate_files
# preprocess = file.example ? add_badges : identity
# Literate.markdown(file.src, file.dest; documenter=true, credit=false,
# preprocess=preprocess)
# Literate.notebook(file.src, file.dest; credit=false,
# execute=CONTINUOUS_INTEGRATION || DEBUG)
Literate.markdown(file.src, file.dest; documenter = true, credit = false)
Literate.notebook(file.src, file.dest; credit = false,
execute = CONTINUOUS_INTEGRATION || DEBUG)
end
# Generate the docs in BUILDPATH
makedocs(; modules = [DFWannier],
format = Documenter.HTML(
# Use clean URLs, unless built as a "local" build
; prettyurls = CONTINUOUS_INTEGRATION,
canonical = "https://louisponet.github.io/DFWannier.jl/stable/",
assets = ["assets/favicon.ico"]),
sitename = "DFWannier.jl", authors = "Louis Ponet", linkcheck = false, # TODO
linkcheck_ignore = [
# Ignore links that point to GitHub's edit pages, as they redirect to the
# login screen and cause a warning:
r"https://github.com/([A-Za-z0-9_.-]+)/([A-Za-z0-9_.-]+)/edit(.*)"],
pages = ["Home" => "index.md",
"Tight Binding" => "tight_binding.md",
# "Getting started" => Any["guide/installation.md",
# "guide/configuration.md",
# "Basic Tutorial"=>"guide/basic_tutorial.md",
# "Advanced Tutorial"=>"guide/advanced_tutorial.md"],
"Exchanges" => "exchanges.md",
"Berry" => "berry.md",
"Tutorials" => Any["Band Interpolation" => "generate_bandstructure.md",
"Calculate Magnetic Exchanges" => "calculate_exchanges.md"]
# "Examples" => EXAMPLES,
# "api.md"
# "publications.md",
]
# strict = !DEBUG,
)
# Dump files for managing dependencies in binder
if CONTINUOUS_INTEGRATION
cd(BUILDPATH) do
open("environment.yml", "w") do io
return print(io, """
name: dfwannier
""")
end
# Install Julia dependencies into build
Pkg.activate(".")
for dep in JLDEPS
Pkg.add(dep)
end
end
Pkg.activate(@__DIR__) # Back to Literate / Documenter environment
end
# Deploy docs to gh-pages branch
deploydocs(; repo = "github.com/louisponet/DFWannier.jl.git")
# Remove generated example files
if !DEBUG
for file in literate_files
base = splitext(basename(file.src))[1]
for ext in [".ipynb", ".md"]
rm(joinpath(file.dest, base * ext); force = true)
end
end
end
if !CONTINUOUS_INTEGRATION
println("\nDocs generated, try $(joinpath(BUILDPATH, "index.html"))")
end
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 2086 | using LinearAlgebra#hide
BLAS.set_num_threads(1)#hide
using DFWannier
assets_dir = joinpath(splitdir(pathof(DFWannier))[1], "../test/assets")
# We first read the colinear Hamiltonian from the outputs of wannier90.
hami = read_hamiltonian(joinpath(assets_dir, "wanup.chk"),
joinpath(assets_dir, "wandn.chk"),
joinpath(assets_dir, "wanup.eig"),
joinpath(assets_dir, "wandn.eig"))
# We can the generate the bandstructure by first defining a k-path and then perform the
# interpolation.
structure = read_w90_input(joinpath(assets_dir, "wanup.win")).structure
# First we create some high symmetry kpoints
# then we explicitely interpolate between the high symmetry kpoints to form
# `bands_kpoints`.
kpoints = [Vec3(0.0, 0.0, 0.5),
Vec3(0.0, 0.5, 0.5),
Vec3(0.5, 0.5, 0.5),
Vec3(0.5, 0.5, 0.0),
Vec3(0.5, 0.0, 0.0),
Vec3(0.0, 0.0, 0.0)]
band_kpoints = eltype(kpoints)[]
for i = 1:length(kpoints)-1
for α in range(0, 1, 20)
push!(band_kpoints, Vec3((1-α) .* kpoints[i] .+ α .* kpoints[i+1]))
end
end
# In order to calculate the magnetic exchanges we need to specify the fermi level (e.g. can be found in an nscf output file),
# and we need to specify the atoms we want to calculate the exchanges between.
# We set the number of k points used for the kpoint interpolation, and number of frequency points to calculate the
# contour integral (`n_ωh`, `n_ωv`).
exch = calc_exchanges(hami, structure[element(:Ni)], 12.0; nk=(5,5,5), n_ωh = 300, n_ωv = 30)
# This leads to a list of exchanges where each holds the J matrix, whose trace is the actual exchange between the sites specified
# by `atom1` and `atom2`.
# To calculate the exchange between the atoms in the central unit cell and those in a shifted one we can use R.
# In this specific case we are calculating the exchanges towards the unit cell shifted twice along the `b` cell vector.
exch = calc_exchanges(hami, structure[element(:Ni)], 12.0, R=(0,2,0); nk=(5,5,5), n_ωh = 300, n_ωv = 30)
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 1517 | using DFWannier
using Plots
assets_dir = joinpath(splitdir(pathof(DFWannier))[1], "../test/assets")
# We can use a .chk and .eig file to construct a tight binding Hamiltonian
# in the Wannier basis.
hami = read_hamiltonian(joinpath(assets_dir, "Fe/Fe.chk"), joinpath(assets_dir, "Fe/Fe.eig"))
# We can the generate the bandstructure by first defining a k-path and then perform the
# interpolation.
structure = read_w90_input(joinpath(assets_dir, "Fe/Fe.win")).structure
# First we create some high symmetry kpoints
# then we explicitely interpolate between the high symmetry kpoints to form
# `bands_kpoints`.
kpoints = [Vec3(0.0, 0.0, 0.5),
Vec3(0.0, 0.5, 0.5),
Vec3(0.5, 0.5, 0.5),
Vec3(0.5, 0.5, 0.0),
Vec3(0.5, 0.0, 0.0),
Vec3(0.0, 0.0, 0.0)]
band_kpoints = eltype(kpoints)[]
for i = 1:length(kpoints)-1
for α in range(0, 1, 20)
push!(band_kpoints, Vec3((1-α) .* kpoints[i] .+ α .* kpoints[i+1]))
end
end
bands = wannierbands(hami, band_kpoints)
plot(bands)
# We can also construct a colinear Tight Binding Hamiltonian by
# reading the outputs of up and down Wannierizations
hami = read_hamiltonian(joinpath(assets_dir, "wanup.chk"),
joinpath(assets_dir, "wandn.chk"),
joinpath(assets_dir, "wanup.eig"),
joinpath(assets_dir, "wandn.eig"))
structure = read_w90_input(joinpath(assets_dir, "wanup.win")).structure
bands = wannierbands(hami, band_kpoints)
plot(bands)
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 1127 | #Cleanup don't export everything that doesn't have to be exported
module DFWannier
using Reexport
@reexport using DFControl
using RecipesBase
using LaTeXStrings
using LinearAlgebra
using Base.Threads
using FortranFiles
using DelimitedFiles
using Unitful
using ProgressMeter
using Requires
import Base: @propagate_inbounds
using FastLapackInterface
import LinearAlgebra.BLAS: libblas
import LinearAlgebra: eigen, eigen!
const DFW = DFWannier
export DFW
include("utils.jl")
include("tight_binding.jl")
include("reciprocal.jl")
include("magnetic.jl")
include("wannierfunction.jl")
include("linalg.jl")
include("plotting.jl")
include("exchange.jl")
include("bvector.jl")
include("fileio.jl")
include("berry.jl")
export HamiltonianKGrid
export wannierbands, read_hamiltonian, calc_exchanges, read_w90_input,
kpdos, energy_bins
export uniform_kgrid
export Up, Down, WannierFunction, calc_greens_functions, ExchangeKGrid, HamiltonianKGrid
export generate_wannierfunctions
export write_xsf, read_chk, read_spn
function __init__()
@require Glimpse = "f6e19d58-12a4-5927-8606-ac30a9ce9b69" include("glimpse.jl")
end
end
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 12385 | struct BerryRGrid{T,LT,MT,MT1}
hami::TBHamiltonian{T,LT,MT}
A::Vector{Vec3{MT}} #A_a(R) = <0|r_a|R> is the Fourier transform of the Berrry connection A_a(k) = i<u|del_a u> (a=x,y,z)the berry connection
B::Vector{Vec3{MT}} #B_a(R)=<0n|H(r-R)|Rm> is the Fourier transform of B_a(k) = i<u|H|del_a u> (a=x,y,z)
C::Vector{MT1} #CC_ab(R) = <0|r_a.H.(r-R)_b|R> is the Fourier transform of CC_ab(k) = <del_a u|H|del_b u> (a,b=x,y,z)}
end
#A_a(R) = <0|r_a|R> is the Fourier transform of the Berrry connection A_a(k) = i<u|del_a u> (a=x,y,z)the berry connection
#B_a(R)=<0n|H(r-R)|Rm> is the Fourier transform of B_a(k) = i<u|H|del_a u> (a=x,y,z)
function BerryRGrid(ab_initio_grid::AbInitioKGrid{T}, hami::TBHamiltonian, chk) where {T}
irvec = map(x -> x.R_cryst, hami)
n_wann = n_wannier_functions(ab_initio_grid)
berry_vec = () -> Vec3([zeros(Complex{T}, n_wann, n_wann) for i in 1:3]...)
berry_mat = () -> Mat3([zeros(Complex{T}, n_wann, n_wann) for i in 1:9]...)
n_kpoints = length(ab_initio_grid)
A_q = [berry_vec() for k in 1:n_kpoints]
B_q = [berry_vec() for k in 1:n_kpoints]
C_q = [berry_mat() for k in 1:n_kpoints]
n_nearest = n_nearest_neighbors(ab_initio_grid)
neighbor_weights = ab_initio_grid.neighbor_weights
Threads.@threads for i in 1:n_kpoints
kpoint = ab_initio_grid.kpoints[i]
for n in 1:n_nearest
neighbor_bond = kpoint.neighbors[n]
weight = neighbor_weights[n]
vr = ustrip.(neighbor_bond.vr)
overlap = kpoint.overlaps[n]
h = kpoint.hamis[n]
for v in 1:3
t_fac = 1im * vr[v] * weight
A_q[i][v] .+= t_fac .* overlap
B_q[i][v] .+= t_fac .* h
for n2 in 1:n_nearest
weight2 = neighbor_weights[n2]
neighbor_bond2 = kpoint.neighbors[n2]
vr2 = ustrip.(neighbor_bond2.vr)
uHu = kpoint.uHu[n2, n]
for v2 in 1:3
t_fac2 = t_fac * -1im * weight2 * vr2[v2]
C_q[i][v, v2] .+= t_fac2 .* uHu
end
end
end
end
for v in 1:3
A_q[i][v] .= (A_q[i][v] + A_q[i][v]') / 2
for v2 in 1:v
C_q[i][v, v2] .= C_q[i][v2, v]'
end
end
end
A_R = [berry_vec() for k in 1:length(irvec)]
B_R = [berry_vec() for k in 1:length(irvec)]
C_R = [berry_mat() for k in 1:length(irvec)]
fourier_q_to_R(ab_initio_grid.kpoints, irvec) do iR, ik, phase
for v in 1:3
A_R[iR][v] .+= phase .* A_q[ik][v]
B_R[iR][v] .+= phase .* B_q[ik][v]
for v2 in 1:3
C_R[iR][v2, v] .+= phase .* C_q[ik][v2, v]
end
end
end
ws_shifts, ws_nshifts = chk.ws_shifts_cryst, chk.ws_nshifts
points, degens = chk.ws_R_cryst, chk.ws_degens
A_R_out = [berry_vec() for k in 1:length(irvec)]
B_R_out = [berry_vec() for k in 1:length(irvec)]
C_R_out = [berry_mat() for k in 1:length(irvec)]
for (ir1, (h, shifts, nshifts, degen)) in
enumerate(zip(hami, ws_shifts, ws_nshifts, degens))
for i in eachindex(h.block)
ns = nshifts[i]
frac = 1 / (ns * degen)
for is in 1:ns
rcryst = h.R_cryst + shifts[i][is]
ir2 = findfirst(x -> x.R_cryst == rcryst, hami)
for v in 1:3
A_R_out[ir2][v][i] += A_R[ir1][v][i] * frac
B_R_out[ir2][v][i] += B_R[ir1][v][i] * frac
for v2 in 1:3
C_R_out[ir2][v, v2][i] += C_R[ir1][v, v2][i] * frac
end
end
end
end
end
for i in 1:length(A_R_out)
for v in 1:3
A_R_out[i][v] ./= n_kpoints
B_R_out[i][v] ./= n_kpoints
for v2 in 1:3
C_R_out[i][v, v2] ./= n_kpoints
end
end
end
return BerryRGrid(hami, A_R_out, B_R_out, C_R_out)
end
struct BerryKGrid{T,MT,MT1} <: AbstractKGrid{T}
hamiltonian_kgrid::HamiltonianKGrid{T,MT}
J_plus::Vector{Vec3{MT}}
J_minus::Vector{Vec3{MT}}
J::Vector{Vec3{MT}}
A::Vector{Vec3{MT}}
Ω::Vector{Vec3{MT}} #pseudo form of berry connection A
B::Vector{Vec3{MT}}
C::Vector{MT1}
f::Vector{MT}
g::Vector{MT}
end
function BerryKGrid(berry_R_grid::BerryRGrid, kpoints::Vector{<:Vec3}, fermi::AbstractFloat)
tb_hami = berry_R_grid.hami
hamiltonian_kgrid = HamiltonianKGrid(tb_hami, kpoints)
nk = length(kpoints)
J_plus = [Vec3(zeros_block(tb_hami), zeros_block(tb_hami), zeros_block(tb_hami))
for i in 1:nk]
J_minus = [Vec3(zeros_block(tb_hami), zeros_block(tb_hami), zeros_block(tb_hami))
for i in 1:nk]
J = [Vec3(zeros_block(tb_hami), zeros_block(tb_hami), zeros_block(tb_hami))
for i in 1:nk]
A_k = [Vec3(zeros_block(tb_hami), zeros_block(tb_hami), zeros_block(tb_hami))
for i in 1:nk]
Ω_k = [Vec3(zeros_block(tb_hami), zeros_block(tb_hami), zeros_block(tb_hami))
for i in 1:nk]
B_k = [Vec3(zeros_block(tb_hami), zeros_block(tb_hami), zeros_block(tb_hami))
for i in 1:nk]
C_k = [Mat3([zeros_block(tb_hami) for j in 1:9]...) for i in 1:nk]
f = [zeros_block(tb_hami) for i in 1:nk]
g = [zeros_block(tb_hami) for i in 1:nk]
Threads.@threads for i in 1:nk
Uk = hamiltonian_kgrid.eigvecs[i]
Ek = hamiltonian_kgrid.eigvals[i]
∇Hk = Vec3(zeros_block(tb_hami), zeros_block(tb_hami), zeros_block(tb_hami))
A = A_k[i]
B = B_k[i]
Ω = Ω_k[i]
C = C_k[i]
fourier_transform(tb_hami, kpoints[i]) do n, iR, R_cart, b, fac
Rcart = ustrip.(R_cart)
for v in 1:3
∇Hk[v][n] += Rcart[v] * 1im * fac * b.block[n]
A[v][n] += fac * berry_R_grid.A[iR][v][n]
B[v][n] += fac * berry_R_grid.B[iR][v][n]
for v2 in 1:3
C[v, v2][n] += fac * berry_R_grid.C[iR][v, v2][n]
end
end
Ω[1][n] += 1im * fac *
(Rcart[2] * berry_R_grid.A[iR][3][n] -
Rcart[3] * berry_R_grid.A[iR][2][n])
Ω[2][n] += 1im * fac *
(Rcart[3] * berry_R_grid.A[iR][1][n] -
Rcart[1] * berry_R_grid.A[iR][3][n])
return Ω[3][n] += 1im * fac *
(Rcart[1] * berry_R_grid.A[iR][2][n] -
Rcart[2] * berry_R_grid.A[iR][1][n])
end
J_plus_k = J_plus[i]
J_minus_k = J_minus[i]
J_k = J[i]
occupations_H_gauge = map(x -> x < fermi ? 1 : 0, Ek) #acting like it's only an insulator for now
n_wann = length(Ek)
f[i] .= Uk * diagm(0 => occupations_H_gauge) * Uk'
g[i] .= map(x -> -x, f[i])
for j in 1:n_wann
g[i][j, j] += 1
end
for v in 1:3
Hbar = Uk' * ∇Hk[v] * Uk
for m in 1:n_wann
Ek_m = Ek[m]
for n in 1:n_wann
Ek_n = Ek[n]
if Ek_n > fermi && Ek_m < fermi
J_plus_k[v][n, m] = 1im * Hbar[n, m] / (Ek[m] - Ek[n])
J_minus_k[v][m, n] = 1im * Hbar[m, n] / (Ek[n] - Ek[m])
#else is already taken care of by initializing with zeros
end
J_k[v][m, n] = n == m ? 0.0 : 1im * Hbar[m, n] / (Ek[n] - Ek[m])
end
end
J_plus_k[v] .= Uk * J_plus_k[v] * Uk'
J_minus_k[v] .= Uk * J_minus_k[v] * Uk'
J_k[v] .= Uk * J_k[v] * Uk'
end
end
return BerryKGrid(hamiltonian_kgrid, J_plus, J_minus, J, A_k, Ω_k, B_k, C_k, f, g)
end
n_wannier_functions(bgrid::BerryKGrid) = size(bgrid.f[1], 1)
n_kpoints(bgrid::BerryKGrid) = length(bgrid.f)
core_kgrid(bgrid::BerryKGrid) = core_kgrid(bgrid.hamiltonian_kgrid)
for f in (:Hk, :eigvecs, :eigvals)
@eval $f(bgrid::BerryKGrid) = $f(bgrid.hamiltonian_kgrid)
end
"""
fourier_q_to_R(f::Function, q_vectors, R_vectors)
Performs a fourier transform from the ab-initio kpoints to the wigner seitz unit cells.
The function will be executed inside the fourier transform loop, being called like
`f(iR, ik, phase)`
"""
function fourier_q_to_R(f::Function, q_vectors, R_vectors)
for iR in 1:length(R_vectors)
for ik in 1:length(q_vectors)
phase = exp(-2im * π * (k_cryst(q_vectors[ik]) ⋅ R_vectors[iR]))
f(iR, ik, phase)
end
end
end
const pseudo_α = Vec3(2, 3, 1)
const pseudo_β = Vec3(3, 1, 2)
function orbital_angular_momentum(berry_K_grid::BerryKGrid{T}, fermi) where {T}
nwann = n_wannier_functions(berry_K_grid)
nk = n_kpoints(berry_K_grid)
M_local = [Vec3([zeros(T, nwann, nwann) for i in 1:3]...) for ik in 1:nk]
M_itinerant = [Vec3([zeros(T, nwann, nwann) for i in 1:3]...) for ik in 1:nk]
Threads.@threads for ik in 1:nk
f = berry_K_grid.f[ik]
g = berry_K_grid.g[ik]
A = berry_K_grid.A[ik]
B = berry_K_grid.B[ik]
H = berry_K_grid.hamiltonian_kgrid.Hk[ik]
C = berry_K_grid.C[ik]
J = berry_K_grid.J[ik]
Ω = berry_K_grid.Ω[ik]
for iv in 1:3
α = pseudo_α[iv]
β = pseudo_β[iv]
Fαβ = real.(f * Ω[iv]) .-
2 .*
imag.(f * A[α] * g * J[β] .+ f * J[α] * g * A[β] .+ f * J[α] * g * J[β])
Hαβ = real.(f * H * f * Ω[iv]) .+
2 .*
imag.(f * H * f * A[α] * f * A[β] .-
f * H * f * (A[α] * g * J[β] + J[α] * g * A[β] + J[α] * g * J[β]))
J0 = real.(f * -1im * (C[α, β] - C[α, β]')) .-
2 .* imag.(f * H * A[α] * f * A[β])
J1 = -2 .* imag.(f * J[α] * g * B[β] .- f * J[β] * g * B[α])
J2 = -2 .* imag.(f * J[α] * g * H * g * J[β])
Gαβ = J0 + J1 + J2
M_local[ik][iv] .= Gαβ .- fermi .* Fαβ
M_itinerant[ik][iv] .= Hαβ .- fermi .* Fαβ
end
end
return M_local, M_itinerant
end
function orbital_angular_momentum_w90(berry_K_grid::BerryKGrid{T}) where {T}
nwann = n_wannier_functions(berry_K_grid)
nk = n_kpoints(berry_K_grid)
non_traced_Fαβ = [Vec3([zeros(T, nwann, nwann) for i in 1:3]...) for ik in 1:nk]
non_traced_Hαβ = [Vec3([zeros(T, nwann, nwann) for i in 1:3]...) for ik in 1:nk]
non_traced_Gαβ = [Vec3([zeros(T, nwann, nwann) for i in 1:3]...) for ik in 1:nk]
Threads.@threads for ik in 1:nk
f = berry_K_grid.f[ik]
g = berry_K_grid.g[ik]
A = berry_K_grid.A[ik]
B = berry_K_grid.B[ik]
H = berry_K_grid.hamiltonian_kgrid.Hk[ik]
C = berry_K_grid.C[ik]
J_plus = berry_K_grid.J_plus[ik]
J_minus = berry_K_grid.J_minus[ik]
Ω = berry_K_grid.Ω[ik]
for iv in 1:3
α = pseudo_α[iv]
β = pseudo_β[iv]
non_traced_Fαβ[ik][iv] .+= real.(f * Ω[iv]) .-
2 .*
imag.(A[α] * J_plus[β] .+ J_minus[α] * A[β] .+
J_minus[α] * J_plus[β])
t_1 = H * A[α]
t_3 = H * Ω[iv]
t_2 = -1im * (C[α, β] - C[α, β]')
t_4 = t_1 * f
t_5 = t_4 * A[β]
s = 2 .* imag.(f * t_5)
non_traced_Gαβ[ik][iv] .+= real.(f * t_2) .- s
non_traced_Hαβ[ik][iv] .+= real.(f * t_3) .+ s
t_4 = H * J_minus[α]
non_traced_Gαβ[ik][iv] .-= 2 .* imag.(J_minus[α] * B[β] .- J_minus[β] * B[α])
non_traced_Hαβ[ik][iv] .-= 2 .* imag.(t_1 * J_plus[β] .+ t_4 * A[β])
t_4 = J_minus[α] * H
t_5 = H * J_minus[α]
non_traced_Gαβ[ik][iv] .-= 2 .* imag.(t_4 * J_plus[β])
non_traced_Hαβ[ik][iv] .-= 2 .* imag.(t_5 * J_plus[β])
end
end
return non_traced_Fαβ ./ nk, non_traced_Hαβ ./ nk, non_traced_Gαβ ./ nk
end
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 24552 | using Printf: @printf
using LinearAlgebra
import NearestNeighbors as NN
export get_bvectors
"""
make_supercell(kpoints, replica)
Make a supercell of kpoints by translating it along 3 directions.
On output there are `(2*replica + 1)^3` cells, in fractional coordinates.
# Arguments
- `kpoints`: `3 * n_kpts`, in fractional coordinates
- `replica`: `3`, number of repetitions along ±x, ±y, ±z directions
"""
function make_supercell(
kpoints::Vector{Vec3{T}}, replica::AbstractVector{<:AbstractRange}
) where {T}
n_kpts = length(kpoints)
rep_x, rep_y, rep_z = replica
n_cell = length(rep_x) * length(rep_y) * length(rep_z)
supercell = Vector{Vec3{T}}(undef, n_cell * n_kpts)
translations = zeros(Vec3{Int}, n_cell * n_kpts)
counter = 1
for ix in rep_x
for iy in rep_y
for iz in rep_z
for ik in 1:n_kpts
supercell[counter] = kpoints[ik] + Vec3(ix, iy, iz)
translations[counter] = Vec3(ix, iy, iz)
counter += 1
end
end
end
end
return supercell, translations
end
"""
make_supercell(kpoints, replica=5)
Make a supercell of kpoints by translating it along 3 directions.
# Arguments
- `replica`: integer, number of repetitions along ±x, ±y, ±z directions
"""
function make_supercell(kpoints::Vector{<:Vec3}, replica::Integer=5)
return make_supercell(
kpoints, [(-replica):replica, (-replica):replica, (-replica):replica]
)
end
"""
BVectorShells
Shells of bvectors.
The bvectors are sorted by norm such that equal-norm bvectors are grouped into one shell.
# Fields
- `recip_lattice`: `3 * 3`, each column is a reciprocal lattice vector
- `kpoints`: `3 * n_kpts`, in fractional coordinates
- `bvectors`: vectors of `3 * n_bvecs_per_shell`, in cartesian coordinates
- `weights`: vector of float, weights of each shell
- `multiplicities`: number of bvectors in each shell
- `n_bvecs`: total number of bvectors
"""
struct BVectorShells{T<:Real}
# reciprocal lattice, 3 * 3, Å⁻¹ unit, each column is a lattice vector
recip_lattice::Mat3{T}
# kpoints array, fractional coordinates, 3 * n_kpts
kpoints::Vector{Vec3{T}}
# bvectors of each shell, Cartesian! coordinates, Å⁻¹ unit
# n_shells of 3 * multiplicity
bvectors::Vector{Vector{Vec3{T}}}
# weight of each shell, length = n_shells
weights::Vector{T}
# multiplicity of each shell, length = n_shells
multiplicities::Vector{Int}
# number of shells
n_shells::Int
end
"""
BVectorShells(recip_lattice, kpoints, bvectors, weights)
Constructor of `BVectorShells`.
Only essential arguments are required, remaing fields of `BVectorShells`
are initialized accordingly.
This should be used instead of directly constructing `BVectorShells`.
# Arguments
- `recip_lattice`: `3 * 3`, each column is a reciprocal lattice vector
- `kpoints`: `3 * n_kpts`, in fractional coordinates
- `bvectors`: vectors of `3 * n_bvecs_per_shell`, in cartesian coordinates
- `weights`: vector of float, weights of each shell
"""
function BVectorShells(
recip_lattice::Mat3{T},
kpoints,
bvectors,
weights::AbstractVector{T},
) where {T<:Real}
n_shells = length(bvectors)
multiplicities = [length(bvectors[i]) for i in 1:n_shells]
return BVectorShells{T}(
recip_lattice, kpoints, bvectors, weights, multiplicities, n_shells
)
end
function Base.show(io::IO, shells::BVectorShells)
for i in 1:(shells.n_shells)
@printf(io, "b-vector shell %3d weight = %8.5f\n", i, shells.weights[i])
vecs = shells.bvectors[i]
for ib in 1:length(vecs)
ending = (i == shells.n_shells) && (ib == length(vecs)) ? "" : "\n"
@printf(io, " %3d %10.5f %10.5f %10.5f%s", ib, vecs[ib]..., ending)
end
end
end
"""
BVectors
The bvectors for each kpoint.
# Fields
- `recip_lattice`: `3 * 3`, each column is a reciprocal lattice vector
- `kpoints`: `3 * n_kpts`, in fractional coordinates
- `bvectors`: `3 * n_bvecs`, in cartesian coordinates
- `weights`: `n_bvecs`, weights of each bvector
- `kpb_k`: k+b vectors at kpoint `k`, `k` -> `k + b`
(index of periodically equivalent kpoint inside `recip_lattice`)
- `kpb_b`: `3 * n_bvecs * n_kpts`,
displacements between k + b and its periodic image inside `recip_lattice`,
such that k+b = `kpoints[:, kpb_k[ib, ik]] + kpb_b[:, ib, ik]` (in fractional)
- `n_kpts`: number of kpoints
- `n_bvecs`: total number of bvectors
!!! note
In principle, we don't need to sort the bvectors for each kpoint, so that
the bvectors have the same order as each kpoint.
However, since `Wannier90` sort the bvectors, and the `mmn` file is written
in that order, so we also sort in the same order as `Wannier90`.
"""
struct BVectors{T<:Real}
# reciprocal lattice, 3 * 3, Å⁻¹ unit
# each column is a reciprocal lattice vector
recip_lattice::Mat3{T}
# kpoints array, fractional coordinates, 3 * n_kpts
kpoints::Vector{Vec3{T}}
# bvectors, Cartesian! coordinates, Å⁻¹ unit, 3 * n_bvecs
bvectors::Vector{Vec3{T}}
# weight of each bvec, n_bvecs
weights::Vector{T}
# k+b vectors at kpoint k, n_bvecs * n_kpts
# k -> k + b (index of periodically equivalent kpoint inside recip_lattice)
kpb_k::Vector{Vector{Int}}
# displacements between k + b and k + b wrapped around into the recip_lattice,
# fractional coordinates, actually always integers since they are
# the number of times to shift along each recip lattice.
# 3 * n_bvecs * n_kpts, where 3 is [b_x, b_y, b_z]
kpb_b::Vector{Vector{Vec3{Int}}}
end
function Base.getproperty(x::BVectors, sym::Symbol)
if sym == :n_kpts
return length(x.kpoints)
elseif sym == :n_bvecs
return length(x.bvectors)
else
# fallback to getfield
getfield(x, sym)
end
end
function Base.show(io::IO, bvectors::BVectors)
println(io, "b-vectors:")
@printf(io, " [bx, by, bz] / Å⁻¹ weight\n")
for i in 1:(bvectors.n_bvecs)
v = bvectors.bvectors[i]
w = bvectors.weights[i]
ending = i < bvectors.n_bvecs ? "\n" : ""
@printf(io, "%3d %10.5f %10.5f %10.5f %10.5f%s", i, v..., w, ending)
end
end
"""
search_shells(kpoints, recip_lattice; atol=1e-6, max_shells=36)
Search bvector shells satisfing B1 condition.
# Arguments
- `kpoints`: fractional coordinates
- `recip_lattice`: each column is a reciprocal lattice vector
# Keyword Arguments
- `atol`: tolerance to select a shell (points having equal distances),
equivalent to `Wannier90` input parameter `kmesh_tol`.
- `max_shells`: max number of nearest-neighbor shells,
equivalent to `Wannier90` input parameter `search_shells`.
"""
function search_shells(
kpoints::Vector{Vec3{T}}, recip_lattice::Mat3{T}; atol::T=1e-6, max_shells::Int=36
) where {T<:Real}
# Usually these "magic" numbers work well for normal recip_lattice.
# Number of nearest-neighbors to be returned
max_neighbors = 500
# Max number of stencils in one shell
max_multiplicity = 40
# max_shells = round(Int, max_neighbors / max_multiplicity)
# 1. Generate a supercell to search bvectors
supercell, _ = make_supercell(kpoints)
# To cartesian coordinates
supercell_cart = similar(supercell)
for ik in 1:length(supercell)
supercell_cart[ik] = recip_lattice * supercell[ik]
end
# use the 1st kpt to search bvectors, usually Gamma point
kpt_orig = recip_lattice * kpoints[1]
# 2. KDTree to search nearest neighbors
kdtree = NN.KDTree(supercell_cart)
idxs, dists = NN.knn(kdtree, kpt_orig, max_neighbors, true)
# activate debug info with: JULIA_DEBUG=Main julia
# @debug "KDTree nearest neighbors" dists
# @debug "KDTree nearest neighbors" idxs
# 3. Arrange equal-distance kpoint indexes in layer of shells
shells = Vector{Vector{Int}}()
# The 1st result is the search point itself, dist = 0
inb = 2
ish = 1
while (inb <= max_neighbors) && (ish <= max_shells)
# use the 1st kpoint to find bvector shells & weights
eqdist_idxs = findall(x -> isapprox(x, dists[inb]; atol=atol), dists)
multi = length(eqdist_idxs)
if multi >= max_multiplicity
# skip large multiplicity shells
inb += multi
break
end
push!(shells, idxs[eqdist_idxs])
inb += multi
ish += 1
end
# 4. Get Cartesian coordinates vectors
n_shells = length(shells)
bvectors = Vector{Vector{Vec3{T}}}(undef, n_shells)
for ish in 1:n_shells
kpb_cart = supercell_cart[shells[ish]]
bvectors[ish] = map(x -> x .- kpt_orig, kpb_cart)
end
@debug "Found bvector shells" bvectors
weights = zeros(T, 0)
return BVectorShells(recip_lattice, kpoints, bvectors, weights)
end
"""
are_parallel(A, B; atol=1e-6)
Check if the columns of matrix `A` and columns of matrix `B` are parallel.
# Arguments
- `A`: matrix
- `B`: matrix
# Keyword Arguments
- `atol`: tolerance to check parallelism
"""
function are_parallel(A::Vector{Vec3{T}}, B::Vector{Vec3{T}}; atol::T=1e-6) where {T<:Real}
nc_A = length(A)
nc_B = length(B)
checkerboard = fill(false, nc_A, nc_B)
for (i, c1) in enumerate(A)
for (j, c2) in enumerate(B)
p = cross(c1, c2)
if all(isapprox.(0, p; atol=atol))
checkerboard[i, j] = true
end
end
end
return checkerboard
end
"""
delete_parallel(bvectors::Vector{Matrix{T}})
Remove shells having parallel bvectors.
# Arguments
- `bvectors`: vector of bvectors in each shell
"""
function delete_parallel(bvectors::Vector{Vector{Vec3{T}}}) where {T<:Real}
n_shells = length(bvectors)
keep_shells = collect(1:n_shells)
for ish in 2:n_shells
for jsh in 1:(ish - 1)
if !(jsh in keep_shells)
continue
end
p = are_parallel(bvectors[jsh], bvectors[ish])
if any(p)
@debug "has parallel bvectors $jsh, $ish"
filter!(s -> s != ish, keep_shells)
break
end
end
end
new_bvectors = bvectors[keep_shells]
@debug "keep shells" keep_shells
@debug "After delete_parallel" [length(b) for b in new_bvectors]' new_bvectors
return new_bvectors
end
"""
delete_parallel(shells::BVectorShells)
Remove shells having parallel bvectors.
# Arguments
- `shells`: `BVectorShells` containing bvectors in each shell
"""
function delete_parallel(shells::BVectorShells)
bvectors = delete_parallel(shells.bvectors)
return BVectorShells(shells.recip_lattice, shells.kpoints, bvectors, shells.weights)
end
"""
compute_weights(bvectors::Vector{Matrix{T}}; atol=1e-6)
Try to guess bvector weights from MV1997 Eq. (B1).
The input bvectors are overcomplete vectors found during shell search, i.e. from `search_shells`.
This function tries to find the minimum number of bvector shells that
satisfy the B1 condition, and return the new `BVectorShells` and weights.
# Arguments
- `bvectors`: vector of bvectors in each shell
# Keyword Arguments
- `atol`: tolerance to satisfy B1 condition,
equivalent to `Wannier90` input parameter `kmesh_tol`
"""
function compute_weights(bvectors::Vector{Vector{Vec3{T}}}; atol::T=1e-6) where {T<:Real}
n_shells = length(bvectors)
n_shells == 0 && error("empty bvectors?")
# only compare the upper triangular part of bvec * bvec', 6 elements
B = zeros(T, 6, n_shells)
# return the upper triangular part of a matrix as a vector
triu2vec(m) = m[triu!(trues(size(m)), 0)]
# triu2vec(I) = [1 0 1 0 0 1]
triu_I = triu2vec(diagm([1, 1, 1]))
W = zeros(n_shells)
# sigular value tolerance, to reproduce W90 behavior
σ_atol = 1e-5
keep_shells = zeros(Int, 0)
ish = 1
while ish <= n_shells
push!(keep_shells, ish)
b = bvectors[ish]
t = reshape(collect(Iterators.flatten(b)), 3, length(b))
B[:, ish] = triu2vec([sum(ik -> b[ik][i] * b[ik][j], 1:length(b)) for i=1:3, j=1:3])
# Solve equation B * W = triu_I
# size(B) = (6, ishell), W is diagonal matrix of size ishell
# B = U * S * V' -> W = V * S^-1 * U' * triu_I
U, S, V = svd(B[:, keep_shells])
@debug "S" ish S = S' keep_shells = keep_shells'
if all(S .> σ_atol)
W[keep_shells] = V * Diagonal(S)^-1 * U' * triu_I
BW = B[:, keep_shells] * W[keep_shells]
@debug "BW" ish BW = BW'
if isapprox(BW, triu_I; atol=atol)
break
end
else
pop!(keep_shells)
end
ish += 1
end
if ish == n_shells + 1
error("not enough shells to satisfy B1 condition")
end
n_shells = length(keep_shells)
# resize
weights = W[keep_shells]
new_bvectors = bvectors[keep_shells]
return new_bvectors, weights
end
"""
compute_weights(shells::BVectorShells; atol=1e-6)
Try to guess bvector weights from MV1997 Eq. (B1).
# Arguments
- `shells`: `BVectorShells` containing bvectors in each shell
# Keyword Arguments
- `atol`: tolerance to satisfy B1 condition,
equivalent to `Wannier90` input parameter `kmesh_tol`
"""
function compute_weights(shells::BVectorShells{T}; atol::T=1e-6) where {T<:Real}
bvectors, weights = compute_weights(shells.bvectors; atol=atol)
return BVectorShells(shells.recip_lattice, shells.kpoints, bvectors, weights)
end
"""
check_b1(shells::BVectorShells; atol=1e-6)
Check completeness (B1 condition) of `BVectorShells`.
# Arguments
- `shells`: `BVectorShells` containing bvectors in each shell
# Keyword Arguments
- `atol`: tolerance, equivalent to `Wannier90` input parameter `kmesh_tol`
"""
function check_b1(shells::BVectorShells{T}; atol::Real=1e-6) where {T}
M = zeros(T, 3, 3)
for ish in 1:(shells.n_shells)
b = shells.bvectors[ish]
M += shells.weights[ish] * [sum(ik -> b[ik][i] * b[ik][j], 1:length(b)) for i=1:3, j=1:3]
end
@debug "Bvector sum" M
Δ = M - Matrix(I, 3, 3)
# compare element-wise, to be consistent with W90
if !all(isapprox.(Δ, 0; atol=atol))
msg = "B1 condition is not satisfied\n"
msg *= " kmesh_tol = $atol\n"
msg *= " Δ = $(maximum(abs.(Δ)))\n"
msg *= " try increasing kmesh_tol?"
error(msg)
end
println("Finite difference condition satisfied")
println()
return nothing
end
"""
flatten_shells(shells::BVectorShells)
Flatten shell vectors into a matrix.
Return a tuple of `(bvecs, bvecs_weight)`, where
- `bvecs`: `3 * n_bvecs`
- `bvecs_weight`: `n_bvecs`
"""
function flatten_shells(shells::BVectorShells{T}) where {T<:Real}
n_bvecs = sum(i -> length(shells.bvectors[i]), 1:shells.n_shells)
bvecs = zeros(Vec3{T}, n_bvecs)
bvecs_weight = zeros(T, n_bvecs)
counter = 1
for ish in 1:(shells.n_shells)
multi = shells.multiplicities[ish]
bvecs[counter:(counter + multi - 1)] = shells.bvectors[ish]
bvecs_weight[counter:(counter + multi - 1)] .= shells.weights[ish]
counter += multi
end
return bvecs, bvecs_weight
end
"""
sort_supercell(translations, recip_lattice; atol=1e-8)
Sort supercell to fix the order of bvectors.
Both input and output `translations` are in fractional coordinates.
# Arguments
- `translations`: `3 * n_supercell` matrix, in fractional coordinates
- `recip_lattice`: each column is a reciprocal lattice vector
# Keyword Arguments
- `atol`: tolerance to compare bvectors,
this is the same as what is hardcoded in `Wannier90`
!!! note
This is used to reproduce `Wannier90` bvector order.
"""
function sort_supercell(
translations::AbstractVector, recip_lattice::AbstractMatrix; atol::Real=1e-8
)
n_cells = length(translations)
distances = zeros(eltype(recip_lattice), n_cells)
for i in 1:n_cells
distances[i] = norm(recip_lattice * translations[i])
end
# In W90, if the distances are degenerate, the distance which has larger index
# is put at the front. Weird but I need to reproduce this.
# So I reverse it, then do a stable sort in ascending order, so that this is a
# "reversed" stable sort in ascending order.
rev_distances = reverse(distances)
# W90 atol = 1e-8, and need the equal sign
lt(x, y) = x <= y - atol
# The permutation is guaranteed to be stable
perm = sortperm(rev_distances; lt=lt)
idxs = collect(n_cells:-1:1)[perm]
return translations[idxs]
end
"""
Find equivalent kpoint and displacement vector of bvectors `bvecs` at kpoint `k`.
all inputs in fractional coordinates.
"""
function _bvec_to_kb(bvecs::AbstractVector, k::AbstractVector, kpoints::AbstractVector)
n_bvecs = length(bvecs)
kpts_equiv = zeros(Int, n_bvecs)
b_equiv = zeros(Vec3{Int}, n_bvecs)
"""Equivalent to periodic image?"""
isequiv(v1, v2; atol=1e-6) = begin
d = v1 - v2
d -= round.(d)
return all(isapprox.(d, 0; atol=atol))
end
for ib in 1:n_bvecs
kpb = k + bvecs[ib]
ik = findfirst(k -> isequiv(kpb, k), kpoints)
kpts_equiv[ib] = ik
b_equiv[ib] = round.(Int, kpb - kpoints[ik])
end
return kpts_equiv, b_equiv
end
"""
Sort bvectors specified by equivalent kpoint indices `k` and cell displacements `b`.
Sorting order:
1. length of bvectors: nearest k+b goes first, this is achieved by comparing
the norm `bvecs_norm`.
2. supercell index: the supercell are already sorted by `sort_supercell`,
which generates our input `translations`.
3. index of kpoint: the smaller index goes first, dictated by the input `kpoints`.
bvecs_norm: length of bvectors, cartesian norm.
k: index in `kpoints` for equivalent kpoint of bvectors
b: cell displacements of bvectors, fractional coordinates
translations: of supercell, fractional coordinates
"""
function _sort_kb(
bvecs_norm::AbstractVector,
k::AbstractVector{Int},
b::AbstractVector{Vec3{Int}},
translations::AbstractVector{Vec3{Int}};
atol::Real=1e-6,
)
n_bvecs = length(k)
# this is for comparing fractional coordinates, 1e-6 should be already safe
isequiv(v1, v2) = isapprox(v1, v2; atol=1e-6)
b_idx = zeros(Int, n_bvecs)
for ib in 1:n_bvecs
b_idx[ib] = findfirst(t -> isequiv(t, b[ib]), translations)
end
lt(i, j) = begin
if bvecs_norm[i] <= bvecs_norm[j] - atol
return true
elseif bvecs_norm[i] >= bvecs_norm[j] + atol
return false
else
if b_idx[i] < b_idx[j]
return true
elseif b_idx[i] == b_idx[j]
if k[i] < k[j]
return true
else
return false
end
else
return false
end
end
end
perm = sortperm(1:n_bvecs; lt=lt)
return perm
end
"""
sort_bvectors(shells::BVectorShells; atol=1e-6)
Sort bvectors in shells at each kpoints, to be consistent with `Wannier90`.
`Wannier90` use different order of bvectors at each kpoint,
in principle, this is not needed. However, the `mmn` file is
written in such order, so we need to sort bvectors and calculate
weights, since `nnkp` file has no section of weights.
# Arguments
- `shells`: `BVectorShells`
# Keyword Arguments
- `atol`: equivalent to `Wannier90` input parameter `kmesh_tol`
"""
function sort_bvectors(shells::BVectorShells{T}; atol::T=1e-6) where {T<:Real}
kpoints = shells.kpoints
recip_lattice = shells.recip_lattice
n_kpts = length(kpoints)
# To sort bvectors for each kpoints, I need to
# calculate distances of supercells to original cell.
# I only need one kpoint at Gamma.
_, translations = make_supercell([Vec3(0,0,0)])
translations = sort_supercell(translations, recip_lattice)
bvecs, bvecs_weight = flatten_shells(shells)
n_bvecs = length(bvecs)
ic = inv(recip_lattice)
bvecs_frac = map(b -> ic * b, bvecs)
bvecs_norm = [norm(bvecs[i]) for i in 1:n_bvecs]
# find k+b indexes
kpb_k = [zeros(Int, n_bvecs) for i = 1:n_kpts]
kpb_b = [zeros(Vec3{Int}, n_bvecs) for i=1:n_kpts]
# weight
kpb_w = [zeros(T, n_bvecs) for i = 1:n_kpts]
for ik in 1:n_kpts
k = kpoints[ik]
# use fractional coordinates to compare
k_equiv, b_equiv = _bvec_to_kb(bvecs_frac, k, kpoints)
perm = _sort_kb(bvecs_norm, k_equiv, b_equiv, translations; atol=atol)
kpb_k[ik] = k_equiv[perm]
kpb_b[ik] = b_equiv[perm]
kpb_w[ik] = bvecs_weight[perm]
end
# kpb_weight is redundant
# @assert sum(abs.(Iterators.flatten(kpb_w) .- Iterators.flatten(bvecs_weight))) < 1e-6
@debug "k+b k" kpb_k
@debug "k+b b" kpb_b
@debug "k+b weights" bvecs_weight
return BVectors(recip_lattice, kpoints, bvecs, bvecs_weight, kpb_k, kpb_b)
end
"""
get_bvectors(kpoints, recip_lattice; kmesh_tol=1e-6)
Generate and sort bvectors for all the kpoints.
# Arguments
- `kpoints`: `3 * n_kpts`, kpoints in fractional coordinates
- `recip_lattice`: `3 * 3`, columns are reciprocal lattice vectors
# Keyword Arguments
- `kmesh_tol`: equivalent to `Wannier90` input parameter `kmesh_tol`
"""
function get_bvectors(
kpoints::Vector{<:Vec3}, recip_lattice::Mat3{<:Real}; kmesh_tol::Real=1e-6
)
# find shells
shells = search_shells(kpoints, recip_lattice; atol=kmesh_tol)
shells = delete_parallel(shells)
shells = compute_weights(shells; atol=kmesh_tol)
show(shells)
println("\n")
check_b1(shells; atol=kmesh_tol)
# generate bvectors for each kpoint
bvectors = sort_bvectors(shells; atol=kmesh_tol)
return bvectors
end
get_bvectors(kpoints::AbstractMatrix, args...; kwargs...) =
get_bvectors(map(i -> Vec3(kpoints[:, i]), axes(kpoints,2)), args...; kwargs...)
"""
index_bvector(kpb_k, kpb_b, k1, k2, b)
Given bvector `b` connecting kpoints `k1` and `k2`, return the index of the bvector `ib`.
This is a reverse search of bvector index if you only know the two kpoints `k1` and `k2`, and
the connecting displacement vector `b`.
# Arguments
- `kpb_k`: `n_bvecs * n_kpts`, k+b kpoints at `k1`
- `kpb_b`: `3 * n_bvecs * n_kpts`, displacement vector for k+b bvectors at `k1`
- `k1`: integer, index of kpoint `k1`
- `k2`: integer, index of kpoint `k2`
- `b`: vector of 3 integer, displacement vector from `k1` to `k2`
"""
function index_bvector(
kpb_k,
kpb_b,
k1::Integer,
k2::Integer,
b::AbstractVector{<:Integer},
)
n_bvecs = size(kpb_k, 1)
for ib in 1:n_bvecs
if kpb_k[k1][ib] == k2 && kpb_b[k1][ib] == b
return ib
end
end
return error("No neighbors found, k1 = $(k1), k2 = $(k2), b = $(b)")
end
function index_bvector(bvectors::BVectors, k1, k2, b)
return index_bvector(bvectors.kpb_k, bvectors.kpb_b, k1, k2, b)
end
"""
get_bvectors_nearest(kpoints, recip_lattice; kmesh_tol=1e-6)
Generate and sort bvectors for all the kpoints.
# Arguments
- `kpoints`: `3 * n_kpts`, kpoints in fractional coordinates
- `recip_lattice`: `3 * 3`, columns are reciprocal lattice vectors
# Keyword Arguments
- `kmesh_tol`: equivalent to `Wannier90` input parameter `kmesh_tol`
"""
function get_bvectors_nearest(kpoints::Vector{Vec3{T}}, recip_lattice::Mat3{T}) where {T<:Real}
n_kx, n_ky, n_kz = get_kgrid(kpoints)
δx, δy, δz = 1 / n_kx, 1 / n_ky, 1 / n_kz
# only 6 nearest neighbors
n_bvecs = 6
bvecs_frac = zeros(T, n_bvecs)
bvecs_frac[1] = Vec3{T}(δx, 0, 0)
bvecs_frac[2] = Vec3{T}(-δx, 0, 0)
bvecs_frac[3] = Vec3{T}(0, δy, 0)
bvecs_frac[4] = Vec3{T}(0, -δy, 0)
bvecs_frac[5] = Vec3{T}(0, 0, δz)
bvecs_frac[6] = Vec3{T}(0, 0, -δz)
# just a fake weight
bvecs_weight = ones(T, n_bvecs)
# generate bvectors for each kpoint
n_kpts = length(kpoints)
kpb_k = [zeros(Int, n_bvecs) for i = 1:n_kpts]
kpb_b = [zeros(Vec3{Int}, n_bvecs) for i = 1:n_kpts]
for ik in 1:n_kpts
k = kpoints[ik]
# use fractional coordinates to compare
k_equiv, b_equiv = _bvec_to_kb(bvecs_frac, k, kpoints)
kpb_k[ik] = k_equiv
kpb_b[ik] = b_equiv
end
bvecs = recip_lattice * bvecs_frac
return BVectors(recip_lattice, kpoints, bvecs, bvecs_weight, kpb_k, kpb_b)
end
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 16904 | import DFControl.Structures: Orbital, Structure, orbital, size
import DFControl.Display.Crayons: @crayon_str
using SpecialFunctions
using SpecialPolynomials
struct SiteDiagonalD{T<:AbstractFloat}
values ::Vector{T}
T ::Matrix{Complex{T}}
end
function setup_ω_grid(ωh, ωv, n_ωh, n_ωv, offset = 0.001)
return vcat(range(ωh, ωh + ωv * 1im; length = n_ωv)[1:end-1],
range(ωh + ωv * 1im, offset + ωv * 1im; length = n_ωh)[1:end-1],
range(offset + ωv * 1im, offset; length = n_ωv))
end
function setup_ω_grid_legendre(ωh, n_ωh, offset = 0.001)
p = 13
x, ws= SpecialPolynomials.gauss_nodes_weights(Legendre, n_ωh)
R= (offset-ωh)/2.0
R0= (offset+ ωh)/2.0
y1 = -log(1+p*pi)
y2 = 0
y = (y1 - y2)/2 .* x .- (y2+y1)/2
phi = (exp.(y) .- 1) ./ p
path = R0 .+ R .* exp.(1.0im.*phi)
return path
end
function integrate_simpson(f, x)
dx = diff(x)
N = length(x)
result = zero(f(1))
for i = 2:2:length(dx)
xpx = dx[i] + dx[i-1]
result += f(i) * (dx[i]^3 + dx[i - 1]^3
+ 3. * dx[i] * dx[i - 1] * xpx) / (6 * dx[i] * dx[i - 1])
result += f(i - 1) * (2. * dx[i - 1]^3 - dx[i]^3
+ 3. * dx[i] * dx[i - 1]^2) / (6 * dx[i - 1] * xpx)
result += f(i + 1) * (2. * dx[i]^3 - dx[i - 1]^3
+ 3. * dx[i - 1] * dx[i]^2) / (6 * dx[i] * xpx)
end
if length(x) % 2 == 0
result += f(N) * (2 * dx[end - 1]^2
+ 3. * dx[end - 2] * dx[end - 1])/ (6 * (dx[end - 2] + dx[end - 1]))
result += f(N - 1) * (dx[end - 1]^2
+ 3*dx[end - 1] * dx[end - 2]) / (6 * dx[end - 2])
result -= f(N - 2) * dx[end - 1]^3/ (6 * dx[end - 2] * (dx[end - 2] + dx[end - 1]))
end
return result
end
struct ExchangeKGrid{T,MT} <: AbstractKGrid{T}
hamiltonian_kgrid::HamiltonianKGrid{T,MT}
phases::Vector{Complex{T}}
D::Matrix{Complex{T}}
end
core_kgrid(x::ExchangeKGrid) = core_kgrid(x.hamiltonian_kgrid)
eigvecs(x::ExchangeKGrid) = eigvecs(x.hamiltonian_kgrid)
eigvals(x::ExchangeKGrid) = eigvals(x.hamiltonian_kgrid)
function ExchangeKGrid(hami::TBHamiltonian, kpoints::Vector{Vec3{T}}, R = zero(Vec3{T})) where {T}
D = ThreadCache(zeros_block(hami))
hami_kpoints = HamiltonianKGrid(hami, kpoints, x -> D .+= x)
nk = length(hami_kpoints)
Ds = reduce(+, D)
return ExchangeKGrid(hami_kpoints, phases(kpoints, R),
Array(Ds[Up()] - Ds[Down()]) / nk)
end
function calc_greens_functions(ω_grid, kpoints, μ::T) where {T}
g_caches = [ThreadCache(fill!(similar(eigvecs(kpoints)[1]), zero(Complex{T})))
for i in 1:3]
Gs = [fill!(similar(eigvecs(kpoints)[1]), zero(Complex{T})) for i in 1:length(ω_grid)]
function iGk!(G, ω)
fill!(G, zero(Complex{T}))
return integrate_Gk!(G, ω, μ, kpoints, cache.(g_caches))
end
p = Progress(length(ω_grid), 1, "Calculating contour G(ω)...")
@threads for j in 1:length(ω_grid)
iGk!(Gs[j], ω_grid[j])
next!(p)
end
return Gs
end
function integrate_Gk!(G::AbstractMatrix, ω, μ, kpoints, caches)
dim = blockdim(G)
cache1, cache2, cache3 = caches
@inbounds for ik in 1:length(kpoints)
# Fill here needs to be done because cache1 gets reused for the final result too
fill!(cache1, zero(eltype(cache1)))
for x in 1:2dim
cache1[x, x] = 1.0 / (μ + ω - eigvals(kpoints)[ik][x])
end
# Basically Hvecs[ik] * 1/(ω - eigvals[ik]) * Hvecs[ik]'
mul!(cache2, eigvecs(kpoints)[ik], cache1)
adjoint!(cache3, eigvecs(kpoints)[ik])
mul!(cache1, cache2, cache3)
t = kpoints.phases[ik]
tp = t'
for i in 1:dim, j in 1:dim
G[i, j] += cache1[i, j] * t
G[i+dim, j+dim] += cache1[i+dim, j+dim] * tp
G[i+dim, j] = cache1[i+dim, j]
G[i, j+dim] = cache1[i, j+dim]
end
end
return G ./= length(kpoints)
end
function integrate_Gk!(G::ColinMatrix, ω, μ, kpoints, caches)
dim = size(G, 1)
cache1, cache2, cache3 = caches
@inbounds for ik in 1:length(kpoints)
# Fill here needs to be done because cache1 gets reused for the final result too
fill!(cache1, zero(eltype(cache1)))
for x in 1:dim
cache1[x, x] = 1.0 / (μ + ω - kpoints.hamiltonian_kgrid.eigvals[ik][x])
cache1[x, x+dim] = 1.0 / (μ + ω - kpoints.hamiltonian_kgrid.eigvals[ik][x+dim])
end
# Basically Hvecs[ik] * 1/(ω - eigvals[ik]) * Hvecs[ik]'
mul!(cache2, kpoints.hamiltonian_kgrid.eigvecs[ik], cache1)
adjoint!(cache3, kpoints.hamiltonian_kgrid.eigvecs[ik])
mul!(cache1, cache2, cache3)
t = kpoints.phases[ik]
tp = t'
for i in 1:dim, j in 1:dim
G[i, j] += cache1[i, j] * t
G[i, j+dim] += cache1[i, j+dim] * tp
end
end
return G ./= length(kpoints)
end
function integrate_Gk!(G_forward::ThreadCache, G_backward::ThreadCache, ω, μ, Hvecs, Hvals,
R, kgrid, caches)
dim = size(G_forward, 1)
cache1, cache2, cache3 = caches
@inbounds for ik in 1:length(kgrid)
# Fill here needs to be done because cache1 gets reused for the final result too
fill!(cache1, zero(eltype(cache1)))
for x in 1:dim
cache1[x, x] = 1.0 / (μ + ω - Hvals[ik][x])
end
# Basically Hvecs[ik] * 1/(ω - eigvals[ik]) * Hvecs[ik]'
mul!(cache2, Hvecs[ik], cache1)
adjoint!(cache3, Hvecs[ik])
mul!(cache1, cache2, cache3)
t = exp(2im * π * dot(R, kgrid[ik]))
G_forward .+= cache1 .* t
G_backward .+= cache1 .* t'
end
G_forward.caches ./= length(kgrid)
return G_backward.caches ./= length(kgrid)
end
abstract type Exchange{T<:AbstractFloat} end
Base.eltype(::Exchange{T}) where {T} = T
Base.eltype(::Type{Exchange{T}}) where {T} = T
function (::Type{E})(at1::Atom, at2::Atom) where {E<:Exchange}
l1 = length(uprange(at1))
l2 = length(uprange(at2))
return E(zeros(Float64, l1, l2), at1, at2)
end
"""
Exchange2ndOrder{T <: AbstractFloat}
This holds the exhanges between different orbitals and calculated sites.
Projections and atom datablocks are to be found in the corresponding wannier input file.
It turns out the ordering is first projections, then atom order in the atoms datablock.
"""
mutable struct Exchange2ndOrder{T<:AbstractFloat} <: Exchange{T}
J::Matrix{T}
atom1::Atom
atom2::Atom
end
function Base.show(io::IO, e::Exchange)
print(io, crayon"red", "atom1:", crayon"reset")
println(io, "name: $(e.atom1.name), pos: $(e.atom1.position_cryst)")
print(io, crayon"red", " atom2:", crayon"reset")
println(io, "name: $(e.atom2.name), pos: $(e.atom2.position_cryst)")
println(io, crayon"red","dist:",crayon"reset", "$(norm(e.atom2.position_cart))")
return print(io, crayon"red", " J: ", crayon"reset", "$(sum(e.J))")
end
"""
Exchange4thOrder{T <: AbstractFloat}
This holds the exhanges between different orbitals and calculated sites.
Projections and atom datablocks are to be found in the corresponding wannier input file.
It turns out the ordering is first projections, then atom order in the atoms datablock.
"""
mutable struct Exchange4thOrder{T<:AbstractFloat} <: Exchange{T}
J::Matrix{T}
atom1::Atom
atom2::Atom
end
"""
calc_exchanges(hamiltonian::TBHamiltonian, atoms::Vector{<:Atom}, fermi, exchange_type; kwargs...)
Calculates the magnetic exchange parameters between the `atoms`. `exchange_type` can be [`Exchange2ndOrder`](@ref) or [`Exchange4thOrder`](@ref). The `kwargs` control various numerical parameters for the calculation:
- `nk = (10,10,10)`: the amount of _k_-points to be used for the uniform interpolation grid.
- `R = (0,0,0)`: the unit cell index to which the exchange parameters are calculated.
- `ωh = -30.0`: the lower bound of the energy integration
- `ωv = 0.15`: the height of the contour in complex space to integrate the Green's functions
- `n_ωh = 3000`: number of integration points along the horizontal contour direction
- `n_ωv = 500`: number of integration points along the vertical contour direction
- `site_diagonal = false`: if `true` the hamiltonians and `Δ` will diagonalized on-site and the
returned exchange matrices hold the exchanges between well-defined orbitals. If this is not done,
the exchange matrices entries don't mean anything on themselves and a trace should be performed to
find the exchange between the spins on sites `i` and `j`.
"""
function calc_exchanges(hami, structure::DFControl.Structures.Structure, atsyms::Vector{Symbol}, fermi::T, ::Type{E} = Exchange2ndOrder;
nk::NTuple{3,Int} = (10, 10, 10),
R = Vec3(0, 0, 0),
ωh::T = T(-30.0), # starting energy
n_ωh::Int = 100,
emax::T = T(0.001)) where {T<:AbstractFloat,E<:Exchange}
R_ = Vec3(R...)
μ = fermi
ω_grid = setup_ω_grid_legendre(ωh, n_ωh, emax)
exchanges = E{T}[]
for at1 in Iterators.flatten(map(x->structure[element(x)], atsyms))
for at2 in Iterators.flatten(map(x->structure[element(x)], atsyms))
at2_ = deepcopy(at2)
at2_.position_cart = at2_.position_cart .+ structure.cell * Vec3(R...)
push!(exchanges, E(at1, at2_))
end
end
kpoints = ExchangeKGrid(hami, uniform_shifted_kgrid(nk...), R_)
calc_exchanges!(exchanges, μ, ω_grid, kpoints, kpoints.D)
return exchanges
end
function calc_exchanges!(exchanges::Vector{<:Exchange{T}},
μ::T,
ω_grid::AbstractArray{Complex{T}},
kpoints,
D::Matrix{Complex{T}}) where {T<:AbstractFloat}
dim = size(kpoints.hamiltonian_kgrid.eigvecs[1])
d2 = div(dim[1], 2)
J_caches = [ThreadCache(zeros(T, size(e.J))) for e in exchanges]
Gs = calc_greens_functions(ω_grid, kpoints, μ)
for j in 1:length(exchanges)
J_caches[j] .+= imag.(integrate_simpson(i -> Jω(exchanges[j], D, Gs[i]), ω_grid))
end
for (eid, exch) in enumerate(exchanges)
exch.J = -1e3 / 4π * reduce(+, J_caches[eid])
end
end
spin_sign(D) = -sign(real(tr(D))) # up = +1, down = -1. If D_upup > D_dndn, onsite spin will be down and the tr(D) will be positive. Thus explaining the - in front of this.
spin_sign(D::Vector) = sign(real(sum(D))) # up = +1, down = -1
@inline function Jω(exch, D, G)
if size(D, 1) < size(G, 1)
ra1 = uprange(exch.atom1)
ra2 = uprange(exch.atom2)
else
ra1 = range(exch.atom1)
ra2 = range(exch.atom2)
end
D_site1 = view(D, ra1, ra1)
D_site2 = view(D, ra2, ra2)
s1 = spin_sign(D_site1)
s2 = spin_sign(D_site2)
t = zeros(ComplexF64, size(exch.J))
G_forward = view(G, exch.atom1, exch.atom2, Up())
G_backward = view(G, exch.atom2, exch.atom1, Down())
for j in 1:size(t, 2), i in 1:size(t, 1)
t[i, j] = s1 * s2 *
D_site1[i,i] *
G_forward[i, j] *
D_site2[j, j] *
G_backward[j, i]
end
return t
end
mutable struct AnisotropicExchange2ndOrder{T<:AbstractFloat} <: Exchange{T}
J::Matrix{Matrix{T}}
atom1::Atom
atom2::Atom
end
function AnisotropicExchange2ndOrder(at1::Atom, at2::Atom)
return AnisotropicExchange2ndOrder{Float64}([zeros(length(range(at1)),
length(range(at1)))
for i in 1:3, j in 1:3], at1, at2)
end
function calc_anisotropic_exchanges(hami, atoms, fermi::T;
nk::NTuple{3,Int} = (10, 10, 10),
R = Vec3(0, 0, 0),
ωh::T = T(-30.0), # starting energy
ωv::T = T(0.1), # height of vertical contour
n_ωh::Int = 3000,
n_ωv::Int = 500,
temp::T = T(0.01)) where {T<:AbstractFloat}
μ = fermi
k_grid = uniform_shifted_kgrid(nk...)
ω_grid = setup_ω_grid(ωh, ωv, n_ωh, n_ωv)
exchanges = setup_anisotropic_exchanges(atoms)
Hvecs, Hvals, D = DHvecvals(hami, k_grid, atoms)
calc_anisotropic_exchanges!(exchanges, μ, R, k_grid, ω_grid, Hvecs, Hvals, D)
return exchanges
end
function calc_anisotropic_exchanges!(exchanges::Vector{AnisotropicExchange2ndOrder{T}},
μ::T,
R::Vec3,
k_grid::AbstractArray{Vec3{T}},
ω_grid::AbstractArray{Complex{T}},
Hvecs::Vector{Matrix{Complex{T}}},
Hvals::Vector{Vector{T}},
D::Vector{Vector{Matrix{Complex{T}}}}) where {T<:AbstractFloat}
dim = size(Hvecs[1])
J_caches = [ThreadCache([zeros(T, size(e.J[i, j])) for i in 1:3, j in 1:3])
for e in exchanges]
g_caches = [ThreadCache(zeros(Complex{T}, dim)) for i in 1:3]
G_forward, G_backward = [ThreadCache(zeros(Complex{T}, dim)) for i in 1:2]
function iGk!(ω)
fill!(G_forward, zero(Complex{T}))
fill!(G_backward, zero(Complex{T}))
return integrate_Gk!(G_forward, G_backward, ω, μ, Hvecs, Hvals, R, k_grid, g_caches)
end
for j in 1:length(ω_grid[1:end-1])
ω = ω_grid[j]
dω = ω_grid[j+1] - ω
iGk!(ω)
# The two kind of ranges are needed because we calculate D only for the projections we care about
# whereas G is calculated from the full Hamiltonian, the is needed.
for (eid, exch) in enumerate(exchanges)
rm = range(exch.atom1)
rn = range(exch.atom2)
for i in 1:3, j in 1:3 # x,y,z
J_caches[eid][i, j] .+= imag.((view(D[eid][i], 1:length(rm), 1:length(rm)) *
view(G_forward, rm, rn) *
view(D[eid][j], 1:length(rn), 1:length(rn)) *
view(G_backward, rn, rm)) .* dω)
end
end
end
for (eid, exch) in enumerate(exchanges)
exch.J = 1e3 / 2π * reduce(+, J_caches[eid])
end
end
function setup_anisotropic_exchanges(atoms::Vector{Atom})
exchanges = AnisotropicExchange2ndOrder{Float64}[]
for (i, at1) in enumerate(atoms), at2 in atoms[i:end]
push!(exchanges, AnisotropicExchange2ndOrder(at1, at2))
end
return exchanges
end
@doc raw"""
DHvecvals(hami::TBHamiltonian{T, Matrix{T}}, k_grid::Vector{Vec3{T}}, atoms::Atom{T}) where T <: AbstractFloat
Calculates $D(k) = [H(k), J]$, $P(k)$ and $L(k)$ where $H(k) = P(k) L(k) P^{-1}(k)$.
`hami` should be the full Hamiltonian containing both spin-diagonal and off-diagonal blocks.
"""
function DHvecvals(hami, k_grid::AbstractArray{Vec3{T}},
atoms::Vector{Atom}) where {T<:AbstractFloat}
nk = length(k_grid)
Hvecs = [zeros_block(hami) for i in 1:nk]
Hvals = [Vector{T}(undef, blocksize(hami, 1)) for i in 1:nk]
δH_onsite = ThreadCache([[zeros(Complex{T}, 2length(range(at)), 2length(range(at)))
for i in 1:3] for at in atoms])
calc_caches = [HermitianEigenWs(block(hami[1])) for i in 1:nthreads()]
for i in 1:nk
# for i=1:nk
tid = threadid()
# Hvecs[i] is used as a temporary cache to store H(k) in. Since we
# don't need H(k) but only Hvecs etc, this is ok.
Hk!(Hvecs[i], hami, k_grid[i])
for (δh, at) in zip(δH_onsite, atoms)
rat = range(at)
lr = length(rat)
δh .+= commutator.((view(Hvecs[i], rat, rat),), at[:operator_block].J) # in reality this should be just range(at)
# δh .+= commutator.(([Hvecs[i][rat, rat] zeros(Complex{T},lr, lr); zeros(Complex{T}, lr, lr) Hvecs[i][div(blocksize(hami, 1), 2) .+ rat, div(blocksize(hami, 1), 2) .+ rat]],), at[:operator_block].J) #in reality this should be just range(at)
end
eigen!(Hvals[i], Hvecs[i], calc_caches[tid])
end
return Hvecs, Hvals, reduce(+, δH_onsite) ./ nk
end
commutator(A1, A2) = A1 * A2 - A2 * A1
function totocc(Hvals, fermi::T, temp::T) where {T}
totocc = zero(Complex{T})
for i in 1:length(Hvals)
totocc += reduce(+, 1 ./ (exp.((Hvals[i] .- fermi) ./ temp) .+ 1))
end
return totocc / length(Hvals)
end
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 31096 | import DFControl.Utils: searchdir, strip_split, getfirst
using DFControl.Structures: ismagnetic
"""
read_chk(chk_file)
read_chk(job::Job)
Reads a Wannier90 .chk file returning a `NamedTuple` containing all the information.
"""
function read_chk(filename)
f = FortranFile(filename)
header = String(read(f, FString{33}))
n_bands = Int(read(f, Int32))
n_excluded_bands = Int(read(f, Int32))
if n_excluded_bands != 0
read(f, (Int32, n_excluded_bands))
else
read(f)
read(f)
end
real_lattice = 1DFControl.angstrom .* (Mat3(read(f, (Float64, 3, 3))...))
recip_lattice = K_CART_TYPE{Float64}.(Mat3(read(f, (Float64, 3, 3))...)')
n_kpoints = read(f, Int32)
mp_grid = Vec3(Int.(read(f, (Int32, 3)))...)
kpt_lattice_t = read(f, (Float64, 3, n_kpoints))
kpt_lattice = [Vec3(kpt_lattice_t[:, i]...) for i in 1:size(kpt_lattice_t,2)]
k_nearest_neighbors = read(f, Int32)
n_wann = read(f, Int32)
chkpt = strip(String(read(f, FString{20})))
have_disentangled = read(f, Int32) != 0 ? true : false
if have_disentangled
omega_invariant = read(f, Float64)
lwindow = map(x -> x != 0 ? true : false, read(f, (Int32, n_bands, n_kpoints)))
ndimwin = read(f, (Int32, n_kpoints))
U_matrix_opt = read(f, (Complex{Float64}, n_bands, n_wann, n_kpoints))
else
omega_invariant = 0.0
lwindow = fill(true, n_bands, n_kpoints)
ndimwin = fill(n_wann, n_kpoints)
U_matrix_opt = [i == j ? 1.0im : 0.0im
for i in 1:n_bands, j in 1:n_wann, ik in 1:n_kpoints]
end
U_matrix = read(f, (Complex{Float64}, n_wann, n_wann, n_kpoints))
# Combined effect of disentanglement and localization
V_matrix = Array{Complex{Float64},3}(undef, n_bands, n_wann, n_kpoints)
if have_disentangled
for ik in 1:n_kpoints
V_matrix[:, :, ik] = U_matrix_opt[:, :, ik] * U_matrix[:, :, ik]
end
else
V_matrix = U_matrix
end
m_matrix = read(f, (Complex{Float64}, n_wann, n_wann, k_nearest_neighbors, n_kpoints))
wannier_centers_t = read(f, (Float64, 3, n_wann))
wannier_centers = [Point3(wannier_centers_t[:, i]...)
for i in 1:size(wannier_centers_t)[2]]
wannier_spreads = read(f, (Float64, n_wann))
wb = nothing
try
wb = read(f, (Float64, k_nearest_neighbors)) #this requires patched w90
catch
@warn "neighbor weights not found, berry calculations won't work. Patch your w90 if this functionality is wanted"
wb = nothing
end
ws_R_cryst, ws_degens = wigner_seitz_points(mp_grid,
metrics(ustrip.(real_lattice),
ustrip.(recip_lattice)).real)
ws_shifts_cryst, ws_nshifts = find_wigner_seitz_shifts(ws_R_cryst, wannier_centers,
real_lattice, mp_grid)
return (n_bands = n_bands,
n_excluded_bands = n_excluded_bands,
cell = real_lattice',
recip_cell = recip_lattice,
n_kpoints = n_kpoints,
mp_grid = mp_grid,
kpoints = kpt_lattice,
n_nearest_neighbors = k_nearest_neighbors,
neighbor_weights = wb,
n_wann = n_wann,
have_disentangled = have_disentangled,
Ω_invariant = omega_invariant,
lwindow = lwindow,
ndimwin = ndimwin,
U_matrix_opt = U_matrix_opt,
U_matrix = U_matrix,
V_matrix = V_matrix,
m_matrix = m_matrix,
wannier_centers = wannier_centers,
wannier_spreads = wannier_spreads,
ws_R_cryst = ws_R_cryst,
ws_degens = ws_degens,
ws_shifts_cryst = ws_shifts_cryst,
ws_nshifts = ws_nshifts)
end
function read_chk(job::Job)
if DFC.iscolin(job.structure)
return map(s -> read_chk(joinpath(job,
"$(name(getfirst(x -> eltype(x)==Wannier90&& x[:spin] == s, job.calculations))).chk")),
["up", "down"])
else
return read_chk(joinpath(job,
"$(name(getfirst(x -> eltype(x)==Wannier90, job.calculations))).chk"))
end
end
# TODO: decide whether we keep NearestNeighbors or look at this here
metrics(chk) = metrics(ustrip.(chk.cell), ustrip.(chk.recip_cell))
function metrics(cell, recip_cell)
real = zeros(3, 3)
recip = zeros(3, 3)
for j in 1:3, i in 1:j
for l in 1:3
real[i, j] += cell[i, l] * cell[j, l]
recip[i, j] += recip_cell[i, l] * recip_cell[j, l]
end
if i < j
real[j, i] = real[i, j]
recip[j, i] = recip[j, i]
end
end
return (real = real, recip = recip)
end
# This is a straight translation from the function in W90, this give the wigner_seitz R points
# The point of this is to determine the R_cryst but also the degeneracies i.e. the periodic images that have
# the exact same distance and will thus have exactly the same TB hamiltonian block.
# This means that if one would be interpolating kpoings without dividing by the degeneracies, the periodic images
# would be "Double counted", which is why we divide by degen. In the actual tb hamiltonian this is fine though, no division needed.
wigner_seitz_points(chk) = wigner_seitz_points(chk.mp_grid, metrics(chk).real)
function wigner_seitz_points(mp_grid, real_metric)
nrpts = 0
r_degens = Int[]
r = Vec3{Int}[]
for n1 in -mp_grid[1]:mp_grid[1], n2 in -mp_grid[2]:mp_grid[2],
n3 in -mp_grid[3]:mp_grid[3]
R = Vec3(n1, n2, n3)
dist_R0 = 0.0
min_dist = typemax(Float64)
ndegen = 1
best_R = copy(R)
for i1 in -2:2, i2 in -2:2, i3 in -2:2
ndiff = R .- Vec3(i1, i2, i3) .* mp_grid
dist = ndiff' * real_metric * ndiff
if abs(dist - min_dist) < 1e-7
ndegen += 1
elseif dist < min_dist
min_dist = dist
ndegen = 1
end
if i1 == i2 == i3 == 0
dist_R0 = dist
end
end
# Only if R is actually the smallest distance it gets added to the R_cryst.
if abs(min_dist - dist_R0) < 1e-7
push!(r, R)
push!(r_degens, ndegen)
end
end
return r, r_degens
end
const WS_DISTANCE_TOL = 1e-5
function find_wigner_seitz_shifts(chk)
return find_wigner_seitz_shifts(chk.ws_R_cryst, chk.wannier_centers, chk.cell,
chk.mp_grid)
end
function find_wigner_seitz_shifts(R_cryst, wannier_centers, cell, mp_grid)
nwann = length(wannier_centers)
ws_shifts_cryst = [[Vec3{Int}[zero(Vec3{Int})] for i in 1:nwann, j in 1:nwann] for iR in 1:length(R_cryst)]
ws_nshifts = [zeros(Int, nwann, nwann) for iR in 1:length(R_cryst)]
c = ustrip.(cell')
ic = inv(c)
for (iR, R) in enumerate(R_cryst)
r_cart = c * R
for i in 1:nwann, j in 1:nwann
best_r_cart = -wannier_centers[i] + r_cart + wannier_centers[j]
nr = norm(best_r_cart)
r_cryst = ic * best_r_cart
for l in -3:3, m in -3:3, n in -3:3
lmn = Vec3(l, m, n)
test_r_cryst = r_cryst + lmn .* mp_grid
test_r_cart = c * test_r_cryst
if norm(test_r_cart) < nr
best_r_cart = test_r_cart
nr = norm(test_r_cart)
ws_shifts_cryst[iR][i, j][1] = lmn .* mp_grid
end
end
if nr < WS_DISTANCE_TOL
ws_nshifts[iR][i, j] = 1
ws_shifts_cryst[iR][i, j][1] = Vec3(0, 0, 0)
else
best_r_cryst = ic * best_r_cart
orig_shift = ws_shifts_cryst[iR][i, j][1]
for l in -3:3, m in -3:3, n in -3:3
lmn = Vec3(l, m, n)
test_r_cryst = best_r_cryst + lmn .* mp_grid
test_r_cart = c * test_r_cryst
if abs(norm(test_r_cart) - nr) < WS_DISTANCE_TOL
ws_nshifts[iR][i, j] += 1
if ws_nshifts[iR][i, j] == 1
ws_shifts_cryst[iR][i, j][ws_nshifts[iR][i, j]] = orig_shift +
lmn .* mp_grid
else
push!(ws_shifts_cryst[iR][i, j], orig_shift + lmn .* mp_grid)
end
end
end
end
end
end
return ws_shifts_cryst, ws_nshifts
end
"""
read_eig(eig_file)
Reads the DFT eigenvalues from a .eig file.
"""
function read_eig(filename)
t = readdlm(filename)
n_bands = maximum(t[:, 1])
n_kpoints = maximum(t[:, 2])
#we follow order of w90 eigval matrix
Hk = Matrix{Float64}(undef, Int(n_bands), Int(n_kpoints))
for x in 1:size(t)[1]
tv = t[x, :]
Hk[Int(tv[1]), Int(tv[2])] = tv[3]
end
return Hk
end
"""
read_hamiltonian(chk::NamedTuple, eigvals::Matrix)
Uses the Wannier90 chkpoint info in `chk` and DFT `eigenvals` read with [`read_eig`] to construct the [`TBHamiltonian`](@ref TBOperator).
"""
function read_hamiltonian(chk::NamedTuple, eigvals::Matrix)
v_mat = chk.V_matrix
R_cryst = chk.ws_R_cryst
Hq = map(1:length(chk.kpoints)) do ik
v = v_mat[1:num_states(chk, ik), 1:chk.n_wann, ik]
return v' * diagm(eigvals[disentanglement_range(chk, ik), ik]) * v
end
c = chk.cell'
Hr_t = [zeros(ComplexF64, chk.n_wann, chk.n_wann) for R in R_cryst]
fourier_q_to_R(chk.kpoints, R_cryst) do iR, ik, phase
@inbounds Hr_t[iR] .+= phase .* Hq[ik]
end
for o in Hr_t
o ./= length(chk.kpoints)
end
return generate_TBBlocks(chk, Hr_t)
end
function read_hamiltonian(chk_file::AbstractString, eig_file::AbstractString)
return read_hamiltonian(read_chk(chk_file), read_eig(eig_file))
end
function read_hamiltonian(up_chk_file::AbstractString, dn_chk_file::AbstractString,
up_eig_file::AbstractString, dn_eig_file::AbstractString)
return read_colin_hami(read_chk(up_chk_file), read_chk(dn_chk_file),
read_eig(up_eig_file), read_eig(dn_eig_file))
end
#super not optimized
#TODO Test: new wigner seitz shift stuff
"""
read_colin_hami(up_chk, down_chk, up_eigvals::AbstractString, down_eigvals::AbstractString)
Returns the colinear TBHamiltonian representing the up-down blocks of the Wannier Tight Binding Hamiltonian.
"""
function read_colin_hami(up_chk, down_chk, up_eigvals::Matrix, down_eigvals::Matrix)
uphami = read_hamiltonian(up_chk, up_eigvals)
downhami = read_hamiltonian(down_chk, down_eigvals)
dim = blocksize(uphami)
@assert dim == blocksize(downhami) "Specified files contain Hamiltonians with different dimensions of the Wannier basis."
u1 = uphami[1]
d1 = downhami[u1.R_cryst]
first = TBBlock(u1.R_cryst,
u1.R_cart,
ColinMatrix(block(u1), block(d1)),
ColinMatrix(u1.tb_block, d1.tb_block))
outhami = [first]
for u in uphami[2:end]
d = downhami[u.R_cryst]
if d !== nothing
push!(outhami,
TBBlock(u.R_cryst, u.R_cart, ColinMatrix(block(u), block(d)),
ColinMatrix(u.tb_block, d.tb_block)))
end
end
return outhami
end
"""
read_hamiltonian(job::Job)
Goes through the job and will attempt to read the hamiltonian files.
If it finds a colinear calculation in the job it will read the up and down hamiltonians,
if the job was either nonmagnetic or noncolinear it will read only one hamiltonian file (there should be only one).
"""
function read_hamiltonian(job::Job)
@assert any(x -> x isa Calculation{Wannier90}, job.calculations) "No wannier90 calculations found in the job."
wcalc = getfirst(x -> x isa Calculation{Wannier90}, job.calculations)
seedname = wcalc.name
eig_files = filter(x -> any(y -> occursin(y.name, x), job.calculations),
reverse(searchdir(job, ".eig")))
chk_files = filter(x -> any(y -> occursin(y.name, x), job.calculations),
reverse(searchdir(job, ".chk")))
@assert !isempty(eig_files) "No eig files ($(seedname).eig) found."
@assert !isempty(chk_files) "No chk files ($(seedname).chk) found."
if !DFC.Jobs.runslocal(job)
tdir = mkpath(tempname())
for f in [eig_files; chk_files]
fname = splitpath(f)[end]
DFC.Servers.pull(job, fname, joinpath(tdir, fname))
end
eig_files = reverse(searchdir(tdir, ".eig"))
chk_files = reverse(searchdir(tdir, ".chk"))
end
if haskey(wcalc, :spin)
hami = read_colin_hami(read_chk.(chk_files)..., read_eig.(eig_files)...)
elseif haskey(wcalc, :spinors)
hami = make_noncolin.(read_hamiltonian(read_chk(chk_files[1]),
read_eig(joinpath(job, eig_files[1]))))
else
hami = read_hamiltonian(read_chk(chk_files[1]),
read_eig(joinpath(job, eig_files[1])))
end
if !DFC.Jobs.runslocal(job)
dir = splitdir(eig_files[1])[1]
rm(dir; recursive = true)
end
return hami
end
# not used
# mutable struct ReciprocalOverlaps{T}
# k_id :: Int
# neighbor_ids :: Vector{Int}
# b_vectors_cryst :: Vector{Vec3{Int}} #connecting vector in crystalline coordinates
# overlaps :: Vector{Matrix{Complex{T}}}
# end
# function ReciprocalOverlaps{T}(k_id::Int, n_nearest_neighbors::Int, nbands::Int) where {T}
# overlap_matrices = [Matrix{Complex{T}}(undef, nbands, nbands)
# for i in 1:n_nearest_neighbors]
# return ReciprocalOverlaps{T}(k_id, zeros(Int, n_nearest_neighbors),
# zeros(Vec3{Int}, n_nearest_neighbors), overlap_matrices)
# end
function read_uHu(file)
try
uHu_file = FortranFile(file)
read(uHu_file, FString{20})
nbands, nkpoints, n_nearest_neighbors = read(uHu_file, (Int32, 3))
out = [Matrix{ComplexF64}(undef, nbands, nbands)
for i in 1:nkpoints*n_nearest_neighbors^2]
for i in 1:nkpoints*n_nearest_neighbors^2
out[i] = transpose(read(uHu_file, (ComplexF64, nbands, nbands)))
end
return out
catch
open(file, "r") do f
readline(f)
nbands, nkpoints, n_nearest_neighbors = parse.(Int, strip_split(readline(f)))
out = [Matrix{ComplexF64}(undef, nbands, nbands)
for i in 1:nkpoints*n_nearest_neighbors^2]
for i in 1:nkpoints*n_nearest_neighbors^2
for j in 1:nbands
for k in 1:nbands
out[i][j, k] = complex(parse.(Float64, strip_split(readline(f)))...)
end
end
end
return out
end
end
end
function fill_overlaps!(grid::Vector{AbInitioKPoint{T}}, mmn_filename::AbstractString,
uHu_filename::AbstractString, wannier_chk_params) where {T}
num_wann = wannier_chk_params.n_wann
uHu_file = FortranFile(uHu_filename)
read(uHu_file, FString{20})
read(uHu_file, (Int32, 3))
open(mmn_filename, "r") do f
readline(f) #header
nbands, nkpoints, n_nearest_neighbors = parse.(Int, strip_split(readline(f)))
#pre setup uHu
for k in grid
k.uHu = [Matrix{Complex{T}}(undef, num_wann, num_wann)
for m in 1:n_nearest_neighbors, n in 1:n_nearest_neighbors]
end
neighbor_counter = 1
for i in 1:nkpoints*n_nearest_neighbors
sline = strip_split(readline(f))
cur_neighbor = mod1(neighbor_counter, n_nearest_neighbors)
ik, ik2 = parse.(Int, sline[1:2])
overlap_ab_initio_gauge = Matrix{Complex{T}}(undef, nbands, nbands)
for n in eachindex(overlap_ab_initio_gauge)
overlap_ab_initio_gauge[n] = complex(parse.(T, strip_split(readline(f)))...)
end
vmat_ik = wannier_chk_params.V_matrix[:, :, ik]
vmat_ik2 = wannier_chk_params.V_matrix[:, :, ik2]
first_band_id_ik = findfirst(wannier_chk_params.lwindow[:, ik])
first_band_id_ik2 = findfirst(wannier_chk_params.lwindow[:, ik2])
num_states_ik = wannier_chk_params.ndimwin[ik]
num_states_ik2 = wannier_chk_params.ndimwin[ik2]
V1 = vmat_ik[1:num_states_ik, 1:num_wann]
V2 = vmat_ik2[1:num_states_ik2, 1:num_wann]
disentanglement_range_k1 = first_band_id_ik:first_band_id_ik+num_states_ik-1
disentanglement_range_k2 = first_band_id_ik2:first_band_id_ik2+num_states_ik2-1
S12 = overlap_ab_initio_gauge[disentanglement_range_k1,
disentanglement_range_k2]
kpoint = grid[ik]
vr = (wannier_chk_params.recip_cell * parse(Vec3{Int}, sline[3:5]) +
grid[ik2].k_cart) - kpoint.k_cart
V1_T = V1'
S12_V2 = S12 * V2
kpoint.overlaps[cur_neighbor] = V1_T * S12_V2
k_eigvals_mat = diagm(kpoint.eigvals[disentanglement_range_k1])
kpoint.hamis[cur_neighbor] = V1_T * k_eigvals_mat * S12_V2
neighbor_counter += 1
for nearest_neighbor2 in 1:n_nearest_neighbors
ik3 = kpoint.neighbors[nearest_neighbor2].k_id2
first_band_id_ik3 = findfirst(wannier_chk_params.lwindow[:, ik3])
num_states_ik3 = wannier_chk_params.ndimwin[ik3]
V3 = wannier_chk_params.V_matrix[1:num_states_ik3, 1:num_wann, ik3]
uHu_k2_k3 = transpose(read(uHu_file, (ComplexF64, nbands, nbands)))
disentanglement_range_k3 = first_band_id_ik3:first_band_id_ik3+num_states_ik3-1
kpoint.uHu[nearest_neighbor2, cur_neighbor] = V3' *
uHu_k2_k3[disentanglement_range_k3,
disentanglement_range_k2] *
V2
end
end
return grid
end
end
function fill_k_neighbors!(kpoints::Vector{AbInitioKPoint{T}}, file::AbstractString,
recip_cell::Mat3) where {T}
kbonds = read_nnkp(file).kbonds
@assert length(kbonds) == length(kpoints) "Number kpoints in seedname.nnkp doesn't match with the number of kpoints in seedname.chk."
for ik in 1:length(kbonds)
nntot = length(kbonds[ik])
kpoints[ik].overlaps = [Matrix{Complex{T}}(undef, 0, 0) for ib in 1:nntot]
kpoints[ik].hamis = [Matrix{Complex{T}}(undef, 0, 0) for ib in 1:nntot]
kpoints[ik].neighbors = kbonds[ik]
kpoints[ik].uHu = Matrix{Matrix{Complex{T}}}(undef, nntot, nntot)
end
return kpoints
end
function read_unk(file)
return occursin("NC", file) ? read_unk_noncollinear(file) : read_unk_collinear(file)
end
function read_unk_collinear(file)
f = FortranFile(file)
ngx, ngy, ngz, nk, nbnd = read(f, (Int32, 5))
Uk = zeros(ComplexF64, ngx, ngy, ngz, nbnd, 1)
for i in 1:nbnd
record = FortranFiles.Record(f)
read!(record, view(Uk, :, :, :, i, 1))
close(record)
end
return Uk
end
function read_unk_noncollinear(file)
f = FortranFile(file)
ngx, ngy, ngz, nk, nbnd = read(f, (Int32, 5))
Uk = zeros(ComplexF64, ngx, ngy, ngz, nbnd, 2)
for i in 1:nbnd
record = FortranFiles.Record(f)
read!(record, view(Uk, :, :, :, i, 1))
close(record)
record = FortranFiles.Record(f)
read!(record, view(Uk, :, :, :, i, 2))
close(record)
end
return Uk
end
"""
read_spn(filename)
Reads a .spn file and returns the DFT Sx, Sy, Sz. They are a `Vectors` with **nk** `Matrices` of size
(**nb**, **nb**), where **nk** is the number of _k_-points and **nb** the number of bands.
"""
function read_spn(filename)
f = FortranFile(filename)
read(f)
nbnd, nk = read(f, (Int32, 2))
Sx, Sy, Sz = [zeros(ComplexF64, nbnd, nbnd) for k in 1:nk],
[zeros(ComplexF64, nbnd, nbnd) for k in 1:nk],
[zeros(ComplexF64, nbnd, nbnd) for k in 1:nk]
for ik in 1:nk
t = read(f, (ComplexF64, 3, div(nbnd * (nbnd + 1), 2)))
counter = 1
for ib1 in 1:nbnd, ib2 in 1:ib1
Sx[ik][ib2, ib1] = t[1, counter]
Sx[ik][ib1, ib2] = conj(t[1, counter])
Sy[ik][ib2, ib1] = t[2, counter]
Sy[ik][ib1, ib2] = conj(t[2, counter])
Sz[ik][ib2, ib1] = t[3, counter]
Sz[ik][ib1, ib2] = conj(t[3, counter])
counter += 1
end
end
return (Sx, Sy, Sz)
end
"""
S_R(chk, Sx, Sy, Sz)
Takes the DFT `Sx`, `Sy`, `Sz` spin matrices and constructs the [`TBSpin`](@ref TBOperator) from them.
Using the Wannier90 checkpoint information in `chk`.
"""
function S_R(chk, Sx, Sy, Sz)
#q is in wannier gauge
nk = length(chk.kpoints)
Sx_q = [zeros(ComplexF64, chk.n_wann, chk.n_wann) for i in 1:nk]
Sy_q = [zeros(ComplexF64, chk.n_wann, chk.n_wann) for i in 1:nk]
Sz_q = [zeros(ComplexF64, chk.n_wann, chk.n_wann) for i in 1:nk]
vmat = chk.V_matrix
nwann = chk.n_wann
for ik in 1:nk
v = vmat[1:num_states(chk, ik), 1:nwann, ik]
disr = disentanglement_range(chk, ik)
Sx_q[ik] = v' * Sx[ik][disr, disr] * v
Sy_q[ik] = v' * Sy[ik][disr, disr] * v
Sz_q[ik] = v' * Sz[ik][disr, disr] * v
end
R_cryst = chk.ws_R_cryst
nR = length(R_cryst)
Sx_R = [zeros(ComplexF64, chk.n_wann, chk.n_wann) for i in 1:nR]
Sy_R = [zeros(ComplexF64, chk.n_wann, chk.n_wann) for i in 1:nR]
Sz_R = [zeros(ComplexF64, chk.n_wann, chk.n_wann) for i in 1:nR]
fourier_q_to_R(chk.kpoints, R_cryst) do iR, ik, phase
Sx_R[iR] .+= Sx_q[ik] .* phase
Sy_R[iR] .+= Sy_q[ik] .* phase
return Sz_R[iR] .+= Sz_q[ik] .* phase
end
for iR in 1:nR
Sx_R[iR] ./= nk
Sy_R[iR] ./= nk
Sz_R[iR] ./= nk
end
return (Sx = generate_TBBlocks(chk, Sx_R),
Sy = generate_TBBlocks(chk, Sy_R),
Sz = generate_TBBlocks(chk, Sz_R))
end
"""
read_spin(chk_file, spn_file)
read_spin(job::Job)
Reads the .spn and .chk files to generate a [`TBSpin`](@ref TBOperator) tight-binding spin operator.
"""
function read_spin(chk_file, spn_file)
Sx_dft, Sy_dft, Sz_dft = read_spn(spn_file)
return S_R(read_chk(chk_file), Sx_dft, Sy_dft, Sz_dft)
end
function read_spin(job::Job)
chk_files = reverse(searchdir(job, ".chk"))
spn_files = reverse(searchdir(job, ".spn"))
isempty(chk_files) && error("No .chk files found in job dir: $(job.local_dir)")
isempty(spn_files) && error("No .spn files found in job dir: $(job.local_dir)")
if length(chk_files) > 1
error("Not implemented for collinear spin-polarized calculations")
end
return readspin(chk_files[1], spn_files[1])
end
"""
read_wannier_blocks(f)
Reads a Wannier90 file such as .nnkp and separates each begin end block into an entry in the ouput `Dict`.
"""
function read_wannier_blocks(f)
out = Dict{Symbol,Any}()
while !eof(f)
l = readline(f)
if occursin("begin", l)
s = Symbol(split(l)[2])
lines = AbstractString[]
l = readline(f)
while !occursin("end", l)
push!(lines, l)
l = readline(f)
end
out[s] = lines
end
end
return out
end
"""
read_nnkp(nnkp_file)
Reads a Wannier90 .nnkp file and returns `(recip_cell, kpoints, kbonds)`.
"""
function read_nnkp(nnkp_file) #not everything, just what I need for now
open(nnkp_file, "r") do f
blocks = read_wannier_blocks(f)
recip_cell = Matrix{K_CART_TYPE{Float64}}(undef, 3, 3)
recip_cell[:, 1] = parse.(Float64, split(blocks[:recip_lattice][1])) .* 1 / 1DFControl.angstrom
recip_cell[:, 2] = parse.(Float64, split(blocks[:recip_lattice][2])) .* 1 / 1DFControl.angstrom
recip_cell[:, 3] = parse.(Float64, split(blocks[:recip_lattice][3])) .* 1 / 1DFControl.angstrom
nkpoints = parse(Int, blocks[:kpoints][1])
kpoints = map(view(blocks[:kpoints], 2:nkpoints+1)) do l
return recip_cell * Vec3(parse.(Float64, split(l)))
end
n_nearest_neighbors = parse(Int, blocks[:nnkpts][1])
k_bonds = map(view(blocks[:nnkpts], 2:length(blocks[:nnkpts]))) do line
sline = strip_split(line)
ik, ik2 = parse.(Int, sline[1:2])
vr = (recip_cell * parse(Vec3{Int}, sline[3:5]) + kpoints[ik2]) - kpoints[ik]
return KBond(ik, ik2, Vec3(vr...))
end
return (recip_cell = recip_cell, kpoints = kpoints, kbonds = k_bonds)
end
end
"""
r_R(chk, kbonds)
Constructs the _r_ [`TBOperator`](@ref) from the Wannier90 checkpoint info `chk` and the `kbond` information that
can be read with [`read_nnkp`](@ref).
"""
function r_R(chk, kbonds)
m_matrix = chk.m_matrix
R_cryst = chk.ws_R_cryst
nR = length(R_cryst)
nwann = chk.n_wann
nntot = chk.n_nearest_neighbors
bshells = search_shells(chk.kpoints, Unitful.ustrip.(chk.recip_cell))
wb = chk.neighbor_weights
r_R = [zeros(Vec3{ComplexF64}, nwann, nwann) for i in 1:nR]
@inbounds fourier_q_to_R(bshells.kpoints, R_cryst) do iR, ik, phase
r_R_t = r_R[iR]
for nn in 1:nntot
w = bshells.weights[nn]
# TODO: can be all from bshells
kb = ustrip.(kbonds[ik][nn].vr)
for m in 1:nwann
for n in 1:nwann
mm = m_matrix[n, m, nn, ik]
if m == n
t = - w .* kb .* imag(log(mm)) .* phase
else
t = 1im * w .* kb .* mm .* phase
end
r_R_t[n, m] += t
end
end
end
end
nk = length(chk.kpoints)
for iR in 1:nR
r_R[iR] ./= nk
end
return generate_TBBlocks(chk, r_R)
end
"""
read_r(chk_file::AbstractString, nnkp_file::AbstractString)
read_r(job::Job)
Constructs the _r_ [`TBOperator`] from the Wannier90 .chk and .nnkp files.
This requires that the `k_neighbor_weights` is written into the .chk file and might
need a patched Wannier90 version.
"""
function read_r(chk_file::AbstractString, nnkp_file::AbstractString)
return r_R(read_chk(chk_file), read_nnkp(nnkp_file).kbonds)
end
function read_r(job::Job)
chk_files = reverse(searchdir(job, ".chk"))
nnkp_files = reverse(searchdir(job, ".nnkp"))
isempty(chk_files) && error("No .chk files found in job dir: $(job.local_dir)")
isempty(nnkp_files) && error("No .spn files found in job dir: $(job.local_dir)")
if length(chk_files) > 1
error("Not implemented for collinear spin-polarized calculations")
end
return read_r(chk_files[1], nnkp_files[1])
end
# """
# read_rmn_file(filename::String, structure::Structure)
# Returns the [`TBRmn`](@ref) operator that defines the _r_ matrix elements between the Wannier functions in different unit cells.
# """
# function read_rmn_file(filename::String, structure::Structure)
# open(filename) do f
# out = RmnBlock{Float64}[]
# readline(f)
# n_wanfun = parse(Int, readline(f))
# readline(f)
# while !eof(f)
# l = split(readline(f))
# R_cryst = Vec3(parse.(Int, l[1:3]))
# block = getfirst(x -> x.R_cryst == R_cryst, out)
# if block == nothing
# block = RmnBlock{Float64}(cell(structure)' * R_cryst, R_cryst,
# Matrix{Point3{Float64}}(I, n_wanfun, n_wanfun))
# push!(out, block)
# end
# dipole = Point3(parse.(Float64, l[6:2:10]))
# block.block[parse.(Int, l[4:5])...] = dipole
# end
# return out
# end
# end
"""
write_xsf(filename::String, wfc::WannierFunction, str::Structure; value_func=x->norm(x))
Writes a [`WannierFunction`](@ref) and [`Structure`](https://louisponet.github.io/DFControl.jl/stable/guide/structure/) to an xsf file that is readable by XCrysden or VESTA.
The values that are written can be controlled by `value_func` that gets used on each entry of `wfc.values` and should output a single `Number`.
"""
function write_xsf(filename::String, wfc::WannierFunction, structure::Structure;
value_func = x -> norm(x))
open(filename, "w") do f
origin = wfc.points[1, 1, 1]
write(f, "# Generated from PhD calculations\n")
write(f, "CRYSTAL\n")
c = ustrip.(structure.cell')
write(f, "PRIMVEC\n")
write(f, "$(c[1,1]) $(c[1,2]) $(c[1,3])\n")
write(f, "$(c[2,1]) $(c[2,2]) $(c[2,3])\n")
write(f, "$(c[3,1]) $(c[3,2]) $(c[3,3])\n")
write(f, "CONVVEC\n")
write(f, "$(c[1,1]) $(c[1,2]) $(c[1,3])\n")
write(f, "$(c[2,1]) $(c[2,2]) $(c[2,3])\n")
write(f, "$(c[3,1]) $(c[3,2]) $(c[3,3])\n")
write(f, "PRIMCOORD\n")
write(f, "$(length(structure.atoms)) 1\n")
for at in structure.atoms
n = at.element.symbol
p = ustrip.(at.position_cart)
write(f, "$n $(p[1]) $(p[2]) $(p[3])\n")
end
write.((f,),
["", "BEGIN_BLOCK_DATAGRID_3D\n", "3D_FIELD\n",
"BEGIN_DATAGRID_3D_UNKNOWN\n"])
write(f, "$(size(wfc)[1]) $(size(wfc)[2]) $(size(wfc)[3])\n")
write(f, "$(origin[1]) $(origin[2]) $(origin[3])\n")
write(f,
"$(wfc.points[end,1,1][1]-origin[1]) $(wfc.points[end,1,1][2]-origin[2]) $(wfc.points[end,1,1][3]-origin[3])\n")
write(f,
"$(wfc.points[1,end,1][1]-origin[1]) $(wfc.points[1,end,1][2]-origin[2]) $(wfc.points[1,end,1][3]-origin[3])\n")
write(f,
"$(wfc.points[1,1,end][1]-origin[1]) $(wfc.points[1,1,end][2]-origin[2]) $(wfc.points[1,1,end][3]-origin[3])\n")
for wfp in wfc.values
write(f, "$(value_func(wfp)) ")
end
write(f, "\n")
return write.((f,), ["END_DATAGRID_3D\n", "END_BLOCK_DATAGRID_3D\n"])
end
end
function read_w90_input(file)
return DFControl.FileIO.wan_parse_calculation(file)
end
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 3963 | using .Glimpse
const Gl = Glimpse
using ColorSchemes
using .Glimpse: RGBf0
struct WfInterface <: Gl.System end
function Gl.update(::WfInterface, m::AbstractLedger)
if isempty(m[WfManager])
return
end
wfman = Gl.singleton(m, WfManager)
curvis = wfman.entities[wfman.current]
gui_func = () -> begin
Gl.Gui.SetNextWindowPos((650, 200), Gl.Gui.ImGuiCond_FirstUseEver)
Gl.Gui.SetNextWindowSize((550, 680), Gl.Gui.ImGuiCond_FirstUseEver)
Gl.Gui.Begin("Wannier Function Manager")
Gl.Gui.SetWindowFontScale(3.3f0)
curid = Int32(wfman.current)
Gl.Gui.@c Gl.Gui.InputInt("Id", &curid)
if 0 < curid <= length(wfman.entities)
wfman.current = Int(curid)
elseif curid <= 0
wfman.current = length(wfman.entities)
else
wfman.current = 1
end
Gl.Gui.@c Gl.Gui.InputDouble("dt", &wfman.dt, 0.01, 0.01, "%.3f")
if wfman.dt <= 0.0
wfman.dt += 0.01
end
if !wfman.iterating
if Gl.Gui.Button("Iterate")
wfman.iterating = true
end
else
if Gl.Gui.Button("Stop Iterating")
wfman.iterating = false
end
end
Gl.Gui.End()
end
push!(Gl.singleton(m, Gl.GuiFuncs).funcs, gui_func)
if wfman.iterating
wfman.current_t += m[Gl.TimingData][1].dtime
if wfman.current_t >= wfman.dt
wfman.current += 1
if wfman.current >= length(wfman.entities)
wfman.current = 1
end
wfman.current_t = 0.0
end
end
vis = m[Gl.Visible]
for e in wfman.entities
vis[e] = Gl.Visible(e == curvis)
end
end
@component Base.@kwdef mutable struct WfManager
entities::Vector{Entity}
wfuncs::Vector{<:WannierFunction}
current::Int = 1
dt::Float64 = 0.5
current_t::Float64 = 0.0
iterating::Bool = false
end
"""
visualize_wfuncs(wfuncs::Vector{<:WannierFunction}, str::Structure;
iso_ratio = 1/4,
alpha = 0.6,
material = Gl.Material(),
phase_channel = Up())
Visualize the wannierfunctions in a Diorama.
The isosurface is determined from the charge, where the coloring signifies the phase of the wavefunction at that point in space.
The `iso_ratio` will be used to determine the isosurface values as the ratio w.r.t the maximum value.
The `phase_channel` denotes whether the phase of the spin up or down channel should be shown in the case of spinor Wannierfunctions.
"""
function visualize_wfuncs(wfuncs::Vector{<:WannierFunction}, str::Structure; kwargs...)
dio = Diorama(; background = RGBAf0(60 / 255, 60 / 255, 60 / 255, 1.0f0))
visualize_wfuncs!(dio, wfuncs, str; kwargs...)
return dio
end
function visualize_wfuncs!(dio::Diorama, wfuncs, str::Structure;
iso_ratio = 1 / 4,
alpha = 0.6,
material = Gl.Material(),
phase_channel = Up())
DFControl.Display.add_structure!(dio, str)
phase_id = length(wfuncs[1].values[1]) > 1 ? (phase_channel == Up() ? 1 : 2) : 1
colfunc(x) = RGBf0(get(ColorSchemes.rainbow, (angle(x[phase_id]) .+ π) / 2π))
wfentities = fill(Entity(0), length(wfuncs))
grid = Gl.Grid([Point3f0(w...) for w in wfuncs[1].points])
for (i, w) in enumerate(wfuncs)
d = Float32.(norm.(w.values))
geom = Gl.DensityGeometry(d, iso_ratio * maximum(d))
color = Gl.DensityColor(colfunc.(w.values))
wfentities[i] = Entity(dio, Gl.Spatial(), grid, geom, color, material,
Gl.Alpha(alpha))
end
man = Entity(dio, WfManager(; entities = wfentities, wfuncs = wfuncs))
insert!(dio, 4, Stage(:wannier, [WfInterface()]))
update(WfInterface(), dio)
return dio
end
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 3080 | struct ThreadCache{T}
caches::Vector{T}
ThreadCache(orig::T) where {T} =
new{T}([deepcopy(orig) for i = 1:nthreads()])
end
@inline cache(t::ThreadCache) =
t.caches[threadid()]
for f in (:getindex, :setindex!, :copyto!, :size, :length, :iterate, :sum, :view, :fill!)
@eval Base.$f(t::ThreadCache{<:AbstractArray}, i...) = Base.$f(cache(t), i...)
end
for op in (:+, :-, :*, :/)
@eval Base.$op(t::ThreadCache{T}, v::T) where {T} = $op(cache(t), v)
@eval Base.$op(v::T, t::ThreadCache{T}) where {T} = $op(v, cache(t))
end
fillall!(t::ThreadCache{<:AbstractArray{T}}, v::T) where {T} =
fill!.(t.caches, (v,))
Base.reduce(op, t::ThreadCache; kwargs...) = reduce(op, t.caches; kwargs...)
LinearAlgebra.mul!(t1::ThreadCache{T}, v::T, t2::ThreadCache{T}) where {T<:AbstractArray} =
mul!(cache(t1), v, cache(t2))
LinearAlgebra.mul!(t1::T, v::T, t2::ThreadCache{T}) where {T<:AbstractArray} =
mul!(t1, v, cache(t2))
LinearAlgebra.mul!(t1::ThreadCache{T}, t2::ThreadCache{T}, t3::ThreadCache{T}) where {T<:AbstractArray} =
mul!(cache(t1), cache(t2), cache(t3))
LinearAlgebra.adjoint!(t1::ThreadCache{T}, v::T) where {T} =
adjoint!(cache(t1), v)
Base.ndims(::Type{ThreadCache{T}}) where {T<:AbstractArray} =
ndims(T)
Base.Broadcast.broadcastable(tc::ThreadCache{<:AbstractArray}) =
cache(tc)
@inline function eigen!(vecs::AbstractMatrix, ws::HermitianEigenWs)
return Eigen(decompose!(ws, 'V', 'A', 'U', vecs, 0., 0., 0, 0, 1e-16)...)
end
@inline function eigen!(vals, vecs::AbstractMatrix, ws::HermitianEigenWs)
ws.w = vals
te = Eigen(decompose!(ws, 'V', 'A', 'U', vecs, 0., 0., 0, 0, 1e-16)...)
return te
end
@inline function eigen!(vals::AbstractVector, vecs::ColinMatrix, c::HermitianEigenWs)
n = div(length(vals),2)
n2 = div(length(vecs),2)
te = eigen!(up(vecs), c)
copyto!(vals, te.values)
copyto!(vecs, te.vectors)
te = eigen!(down(vecs), c)
copyto!(vals, n+1, te.values, 1, n)
copyto!(vecs, n2+1, te.vectors, 1, n2)
return Eigen(vals, vecs)
end
@inline function eigen!(vals::AbstractVector, vecs::NonColinMatrix, c::HermitianEigenWs)
c.w = vals.data
te = eigen!(vecs.data, c)
return Eigen(vals, NonColinMatrix(te.vectors))
end
@inline function eigen(vecs::AbstractMatrix{T}, c::HermitianEigenWs{T}) where {T}
return eigen!(copy(vecs), c)
end
@inline function eigen(vecs::AbstractMagneticMatrix{T}, c::HermitianEigenWs{T}) where {T}
out = copy(vecs)
vals = MagneticVector(similar(out, T <: AbstractFloat ? T : T.parameters[1], size(out, 2)))
return eigen!(vals, out, c)
end
@inline function eigen(h::AbstractMagneticMatrix)
return eigen(h, HermitianEigenWs(h))
end
function Base.Matrix(e::Eigen{CT,T,<:ColinMatrix{CT}}) where {CT, T}
d = size(e.vectors, 1)
return ColinMatrix([e.vectors[1:d, 1:d] * diagm(0 => e.values[1:d]) * e.vectors[1:d, 1:d]' e.vectors[1:d, d + 1:2d] * diagm(0 => e.values[d + 1:2d]) * e.vectors[1:d, d + 1:2d]'])
end
Base.Array(e::Eigen{CT,T,<:ColinMatrix{CT}}) where {CT, T} = Matrix(e)
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 15495 | using LinearAlgebra.LAPACK: BlasInt
abstract type Spin end
struct Up <: Spin end
struct Down <: Spin end
"Represents a magnetic Hamiltonian matrix with the block structure [up updown;downup down]"
abstract type AbstractMagneticMatrix{T} <: AbstractMatrix{T} end
data(m::AbstractMatrix) = m
data(m::AbstractMagneticMatrix) = m.data
Base.similar(::Type{M}, i::NTuple{2,Int}) where {M <: AbstractMagneticMatrix} =
M(Matrix{M.parameters[1]}(undef, i))
for f in (:length, :size, :setindex!, :elsize)
@eval @inline @propagate_inbounds Base.$f(c::AbstractMagneticMatrix, args...) =
Base.$f(c.data, args...)
end
Base.pointer(c::AbstractMagneticMatrix, i::Integer) = pointer(c.data, i)
"Magnetic block dimensions"
blockdim(c::AbstractMatrix) = div(size(data(c), 2), 2)
up(c::AbstractMatrix) = (d = blockdim(c); view(data(c), 1:d, 1:d))
down(c::AbstractMatrix) = (d = blockdim(c); r = d + 1:2 * d; view(data(c), r, r))
# Standard getindex behavior
for f in (:view, :getindex)
@eval @inline @propagate_inbounds Base.$f(c::AbstractMagneticMatrix, args...) =
$f(c.data, args...)
@eval @inline @propagate_inbounds Base.$f(c::AbstractMagneticMatrix, r::Union{Colon, AbstractUnitRange}, i::Int) =
MagneticVector(Base.$f(c.data, r, i))
@eval @inline @propagate_inbounds Base.$f(c::AbstractMagneticMatrix, i::Int, r::Union{Colon, AbstractUnitRange}) =
MagneticVector(Base.$f(c.data, i, r))
end
Base.similar(c::M, args::AbstractUnitRange...) where {M <: AbstractMagneticMatrix} =
M(similar(c.data), args...)
Base.iterate(c::AbstractMagneticMatrix, args...) = iterate(c.data, args...)
"""
ColinMatrix{T, M <: AbstractMatrix{T}} <: AbstractMagneticMatrix{T}
Defines a Hamiltonian Matrix with [up zeros; zeros down] structure.
It is internally only storing the up and down block.
"""
struct ColinMatrix{T,M <: AbstractMatrix{T}} <: AbstractMagneticMatrix{T}
data::M
end
function ColinMatrix(up::AbstractMatrix, down::AbstractMatrix)
@assert size(up) == size(down)
return ColinMatrix([up down])
end
Base.Array(c::ColinMatrix{T}) where T =
(d = blockdim(c); [c[Up()] zeros(T, d, d); zeros(T, d, d) c[Down()]])
down(c::ColinMatrix) = (d = blockdim(c); view(c.data, 1:d, d + 1:2 * d))
blockdim(c::ColinMatrix) = size(c.data, 1)
function LinearAlgebra.diag(c::ColinMatrix)
d = blockdim(c)
r = LinearAlgebra.diagind(d, d)
[c[r];c[r.+last(r)]]
end
"""
NonColinMatrix{T, M <: AbstractMatrix{T}} <: AbstractMagneticMatrix{T}
Defines a Hamiltonian Matrix with [up updown;downup down] structure.
Since atomic projections w.r.t spins are defined rather awkwardly in Wannier90 for exchange calculations,
i.e. storing the up-down parts of an atom sequentially,
a NonColinMatrix reshuffles the entries of a matrix such that it follows the above structure.
"""
struct NonColinMatrix{T,M <: AbstractMatrix{T}} <: AbstractMagneticMatrix{T}
data::M
end
"Reshuffles standard Wannier90 up-down indices to the ones for the structure of a NonColinMatrix."
function Base.convert(::Type{NonColinMatrix}, m::M) where {M <: AbstractMatrix}
@assert iseven(size(m, 1)) "Error, dimension of the supplied matrix is odd, i.e. it does not contain both spin components."
data = similar(m)
d = blockdim(m)
for i in 1:2:size(m, 1), j in 1:2:size(m, 2)
up_id1 = div1(i, 2)
up_id2 = div1(j, 2)
data[up_id1, up_id2] = m[i, j]
data[up_id1 + d, up_id2] = m[i + 1, j]
data[up_id1, up_id2 + d] = m[i, j + 1]
data[up_id1 + d, up_id2 + d] = m[i + 1, j + 1]
end
return NonColinMatrix(data)
end
function NonColinMatrix(up::AbstractMatrix{T}, down::AbstractMatrix{T}) where {T}
@assert size(up) == size(down)
return NonColinMatrix([up zeros(T, size(up));zeros(T, size(up)) down])
end
Base.Array(c::NonColinMatrix) = copy(c.data)
function uprange(a::DFC.Structures.Projection)
projrange = range(a)
if length(projrange) > a.orbital.size
return range(div1(first(projrange), 2), length = div(length(projrange), 2))
else
return projrange
end
end
uprange(a::DFC.Structures.Atom) = vcat(uprange.(a.projections)...)
## Indexing ##
Base.IndexStyle(::AbstractMagneticMatrix) = IndexLinear()
for f in (:view, :getindex)
@eval function Base.$f(c::ColinMatrix, a1::T, a2::T) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}}
projrange1 = range(a1)
projrange2 = range(a2)
return ColinMatrix($f(c, projrange1, projrange2), $f(c, projrange1, projrange2 .+ blockdim(c)))
end
@eval function Base.$f(c::NonColinMatrix, a1::T, a2::T) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}}
up_range1 = uprange(a1)
up_range2 = uprange(a2)
d = blockdim(c)
dn_range1 = up_range1 .+ d
dn_range2 = up_range2 .+ d
return NonColinMatrix([$f(c, up_range1, up_range2) $f(c, up_range1, dn_range2)
$f(c, dn_range1, up_range2) $f(c, dn_range1, dn_range2)])
end
@eval Base.$f(c::AbstractMagneticMatrix, a1::T) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, a1, a1)
@eval Base.$f(c::ColinMatrix, a1::T, a2::T, ::Up) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, range(a1), range(a2))
@eval Base.$f(c::NonColinMatrix, a1::T, a2::T, ::Up) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, uprange(a1), uprange(a2))
@eval Base.$f(c::ColinMatrix, a1::T, a2::T, ::Down) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, range(a1), range(a2) .+ blockdim(c))
@eval Base.$f(c::NonColinMatrix, a1::T, a2::T, ::Down) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, uprange(a1) .+ blockdim(c), uprange(a2) .+ blockdim(c))
@eval Base.$f(c::NonColinMatrix, a1::T, a2::T, ::Up, ::Down) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, uprange(a1), uprange(a2) .+ blockdim(c))
@eval Base.$f(c::NonColinMatrix, a1::T, a2::T, ::Down, ::Up) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, uprange(a1) .+ blockdim(c), uprange(a2))
@eval Base.$f(c::NonColinMatrix, ::Up, ::Down) =
(s = size(c,1); $f(c, 1:div(s, 2), div(s, 2)+1:s))
@eval Base.$f(c::NonColinMatrix, ::Down, ::Up) =
(s = size(c,1); $f(c, div(s, 2)+1:s, 1:div(s, 2)))
@eval Base.$f(c::AbstractMatrix, a1::T, a2::T, ::Up) where {T<:Union{DFC.Structures.Projection, DFC.Structures.Atom}} =
$f(c, range(a1), range(a2))
@eval Base.$f(c::AbstractMatrix, a1::T, a2::T, ::Down) where {T<:Union{DFC.Structures.Projection, DFC.Structures.Atom}} =
$f(c, range(a1), range(a2) .+ blockdim(c))
@eval Base.$f(c::AbstractMagneticMatrix, ::Up) =
(r = 1:blockdim(c); $f(c, r, r))
@eval Base.$f(c::AbstractMagneticMatrix, ::Up, ::Up) =
(r = 1:blockdim(c); $f(c, r, r))
@eval Base.$f(c::ColinMatrix, ::Down) =
(d = blockdim(c); r = 1:d; $f(c, r, r .+ d))
@eval Base.$f(c::ColinMatrix, ::Down, ::Down) =
(d = blockdim(c); r = 1:d; $f(c, r, r .+ d))
@eval Base.$f(c::NonColinMatrix, ::Down) =
(d = blockdim(c); r = d+1 : 2*d; $f(c, r, r))
@eval Base.$f(c::NonColinMatrix, ::Down, ::Down) =
(d = blockdim(c); r = d+1 : 2*d; $f(c, r, r))
@eval Base.$f(c::AbstractMatrix, ::Up) =
(r = 1:blockdim(c); $f(c, r, r))
@eval Base.$f(c::AbstractMatrix, ::Up, ::Up) =
(r = 1:blockdim(c); $f(c, r, r))
@eval Base.$f(c::AbstractMatrix, ::Down) =
(d = blockdim(c); r = d + 1:2 * d; $f(c, r, r))
@eval Base.$f(c::AbstractMatrix, ::Down, ::Down) =
(d = blockdim(c); r = d + 1:2 * d; $f(c, r, r))
end
for op in (:*, :-, :+, :/)
@eval @inline Base.$op(c1::ColinMatrix, c2::ColinMatrix) =
ColinMatrix($op(c1[Up()], c2[Up()]), $op(c1[Down()], c2[Down()]))
@eval @inline Base.$op(c1::NonColinMatrix, c2::NonColinMatrix) =
NonColinMatrix($op(c1.data, c2.data))
end
# BROADCASTING
Base.BroadcastStyle(::Type{T}) where {T<:AbstractMagneticMatrix} =
Broadcast.ArrayStyle{T}()
Base.ndims(::Type{<:AbstractMagneticMatrix}) =
2
Base.similar(bc::Broadcast.Broadcasted{Broadcast.ArrayStyle{T}}, ::Type{ElType}) where {T<:AbstractMagneticMatrix,ElType} =
Base.similar(T, axes(bc))
Base.axes(c::AbstractMagneticMatrix) =
Base.axes(c.data)
@inline @propagate_inbounds Base.broadcastable(c::AbstractMagneticMatrix) =
c
@inline @propagate_inbounds Base.unsafe_convert(::Type{Ptr{T}}, c::AbstractMagneticMatrix{T}) where {T} =
Base.unsafe_convert(Ptr{T}, c.data)
for (elty, cfunc) in zip((:ComplexF32, :ComplexF64), (:cgemm_, :zgemm_))
@eval @inline function LinearAlgebra.mul!(C::ColinMatrix{$elty}, A::ColinMatrix{$elty}, B::ColinMatrix{$elty})
dim = blockdim(C)
dim2 = dim * dim
ccall((LinearAlgebra.LAPACK.@blasfunc($(cfunc)), libblas), Cvoid,
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt},
Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty},
Ref{BlasInt}),
'N', 'N', dim, dim,
dim, one($elty), A, dim,
B, dim, zero($elty), C, dim)
ccall((LinearAlgebra.LAPACK.@blasfunc($(cfunc)), libblas), Cvoid,
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt},
Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty},
Ref{BlasInt}),
'N', 'N', dim, dim,
dim, one($elty), pointer(A, dim2 + 1), dim,
pointer(B, dim2 + 1), dim, zero($elty), pointer(C, dim2 + 1), dim)
return C
end
end
@inline function LinearAlgebra.adjoint(c::AbstractMagneticMatrix)
out = similar(c)
adjoint!(out, c)
end
@inline @inbounds function LinearAlgebra.adjoint!(out::ColinMatrix, in1::ColinMatrix)
dim = blockdim(out)
for i in 1:dim, j in 1:dim
out[j, i] = in1[i, j]'
out[j, i + dim] = in1[i, j + dim]'
end
return out
end
@inline LinearAlgebra.adjoint!(out::NonColinMatrix, in1::NonColinMatrix) =
adjoint!(out.data, in1.data)
@inline LinearAlgebra.tr(c::AbstractMagneticMatrix) =
tr(c[Up()]) + tr(c[Down()])
"Vector following the same convention as the in AbstractMagneticMatrix, i.e. first half of the indices contain the up part, second the down part"
struct MagneticVector{T, VT<:AbstractVector{T}} <: AbstractVector{T}
data::VT
end
for f in (:length, :size, :setindex!, :elsize)
@eval @inline @propagate_inbounds Base.$f(c::MagneticVector, args...) =
Base.$f(c.data, args...)
end
up(c::MagneticVector) = view(c.data, 1:div(length(c), 2))
down(c::MagneticVector) = (lc = length(c); view(c.data, div(lc, 2):lc))
# Standard getindex behavior
@inline @propagate_inbounds Base.getindex(c::MagneticVector, args...) =
getindex(c.data, args...)
for f in (:view, :getindex)
@eval @inline @propagate_inbounds Base.$f(c::MagneticVector, args::AbstractUnitRange...) =
Base.$f(c.data, args...)
end
Base.similar(v::MagneticVector) = MagneticVector(similar(v.data))
"Reshuffles standard Wannier90 up-down indices to the ones for the structure of a MagneticVector."
function Base.convert(::Type{MagneticVector}, v::V) where {V <: AbstractVector}
@assert iseven(length(v)) "Error, dimension of the supplied matrix is odd, i.e. it does not contain both spin components."
data = similar(v)
vl = length(v)
d =div(vl, 2)
for i in 1:2:vl
up_id1 = div1(i, 2)
data[up_id1] = v[i]
data[up_id1 + d] = v[i + 1]
end
return NonColinMatrix(data)
end
## Indexing with atoms and spins ##
for f in (:view, :getindex)
@eval function Base.$f(c::MagneticVector, a1::T) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}}
projrange1 = uprange(a1)
return MagneticVector([$f(c, projrange1); $f(c, projrange1 .+ div(length(c), 2))])
end
@eval Base.$f(c::MagneticVector, a1::T, ::Up) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, uprange(a1))
@eval Base.$f(c::MagneticVector, a1::T, ::Down) where {T <: Union{DFC.Structures.Projection,DFC.Structures.Atom}} =
$f(c, range(a1), uprange(a2) + div(length(c), 2))
@eval Base.$f(c::MagneticVector, ::Up) =
$f(c, 1:div(length(c), 2))
@eval Base.$f(c::MagneticVector, ::Down) =
(lc = length(c); $f(c, div(lc, 2) + 1:lc))
end
for op in (:*, :-, :+, :/)
@eval @inline Base.$op(c1::MagneticVector, c2::MagneticVector) =
MagneticVector($op(c1.data, c2.data))
end
"Generates a Pauli σx matrix with the dimension that is passed through `n`."
function σx(::Type{T}, n::Int) where {T}
return kron(diagm(0 => ones(T, div(n, 2))), SMatrix{2,2}(0, 1, 1, 0)) / 2
end
σx(n::Int) = σx(Float64, n)
"Generates a Pauli σy matrix with the dimension that is passed through `n`."
function σy(::Type{T}, n::Int) where {T}
return kron(diagm(0 => ones(T, div(n, 2))), SMatrix{2,2}(0, -1im, 1im, 0)) / 2
end
σy(n::Int) = σy(Float64, n)
"Generates a Pauli σz matrix with the dimension that is passed through `n`."
function σz(::Type{T}, n::Int) where {T}
return kron(diagm(0 => ones(T, div(n, 2))), SMatrix{2,2}(1, 0, 0, -1)) / 2
end
σz(n::Int) = σz(Float64, n)
#! format: off
for s in (:σx, :σy, :σz)
@eval @inline $s(m::AbstractArray{T}) where {T} = $s(T, size(m, 1))
@eval $s(m::TBHamiltonian) = $s(block(m[1]))
end
#! format: on
σx(m::ColinMatrix{T}) where {T} = zeros(m)
σy(m::ColinMatrix{T}) where {T} = zeros(m)
function σz(m::ColinMatrix{T}) where {T}
return ColinMatrix(diagm(0 => ones(T, size(m, 1))),
diagm(0 => -1.0 .* ones(T, size(m, 1))))
end
function calc_onsite_spin(kpoints::AbstractArray{<:KPoint{T}}, atom, fermi = 0.0) where {T}
S = Vec3(σx(kpoints[1].eigvecs[atom]),
σy(kpoints[1].eigvecs[atom]),
σz(kpoints[1].eigvecs[atom]))
S_out = zero(Vec3{T})
for k in kpoints
for (i, v) in enumerate(k.eigvals)
if i - fermi <= 0.0
vec = k.eigvecs[:, i][atom]
S_out += real((vec',) .* S .* (vec,))
end
end
end
return S_out ./ length(kpoints)
end
function make_noncolin(tb::TBBlock)
return TBBlock(tb.R_cryst, tb.R_cart, convert(NonColinMatrix, tb.block),
convert(NonColinMatrix, tb.tb_block))
end
function make_noncolin(tb::TBBlock{T,LT,ColinMatrix{Complex{T},Matrix{Complex{T}}}}) where {T<:AbstractFloat,
LT<:Length{T}}
return TBBlock(tb.R_cryst, tb.R_cart, NonColinMatrix(tb.block[Up()], tb.block[Down()]),
NonColinMatrix(tb.tb_block[Up()], tb.tb_block[Down()]))
end
make_noncolin(v::Vector) = [v[1:2:end]; v[2:2:end]]
FastLapackInterface.HermitianEigenWs(c::ColinMatrix) = HermitianEigenWs(c[Up()])
FastLapackInterface.HermitianEigenWs(c::NonColinMatrix) = HermitianEigenWs(c.data)
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
|
[
"MIT"
] | 0.2.3 | c8b8a89084dc4841c256be79813592574e76dcf5 | code | 7015 |
@recipe function f(band::WannierBand, data = :eigvals; ks = nothing, fermi = 0,
linewidth = 2)
if ks == :relative
ks = []
k_m = band.kpoints_cryst[div(size(band.kpoints)[1] + 1, 2)]
for k in band.kpoints_cryst
push!(ks, norm(k - k_m))
end
ks[1:div(length(ks), 2)] = -ks[1:div(length(ks), 2)]
else
ks = collect(1:length(band.kpoints_cryst))
end
eigvals = band.eigvals .- fermi
linewidth --> linewidth
out = []
if data == :eigvals
out = eigvals
title --> "Eigenvalues"
yguide --> "energy (eV)"
else
if data == :cm_x
title --> "Center of Mass (X)"
yguide --> "Rx (Angström)"
for cm in band.cms
push!(out, cm[1])
end
elseif data == :cm_y
title --> "Center of Mass (Y)"
yguide --> "Ry (Angström)"
for cm in band.cms
push!(out, cm[2])
end
elseif data == :cm_z
title --> "Center of Mass (Z)"
yguide --> L"R_z" * " (" * L"\AA" * ")"
for cm in band.cms
push!(out, cm[3])
end
elseif data == :angmom_x
title --> "Orbital Angular Momentum (X)"
yguide --> L"L_x (arb. units)"
for angmom in band.angmoms
push!(out, angmom[1][1] + angmom[2][1])
end
elseif data == :angmom_y
title --> "Orbital Angular Momentum (Y)"
yguide --> L"L_y (arb. units)"
for angmom in band.angmoms
push!(out, angmom[1][2] + angmom[2][2])
end
elseif data == :angmom_z
title --> "Orbital Angular Momentum (Z)"
yguide --> "Lz (arb. units)"
for angmom in band.angmoms
push!(out, angmom[1][3] + angmom[2][3])
end
elseif data == :angmom1_x
title --> "Orbital Angular Momentum (X)"
yguide --> "Lx (arb. units)"
label --> "OAM around Ge"
for angmom in band.angmoms
push!(out, angmom[1][1])
end
elseif data == :angmom1_y
title --> "Orbital Angular Momentum (Y)"
yguide --> "Ly (arb. units)"
label --> "OAM around Ge"
for angmom in band.angmoms
push!(out, angmom[1][2])
end
elseif data == :angmom1_z
title --> "Orbital Angular Momentum (Z)"
yguide --> "Lz (arb. units)"
label --> "OAM around Ge"
for angmom in band.angmoms
push!(out, angmom[1][3])
end
elseif data == :angmom2_x
title --> "Orbital Angular Momentum (X)"
yguide --> L"L_x" * " (arb. units)"
label --> "OAM around Te"
for angmom in band.angmoms
push!(out, angmom[2][1])
end
elseif data == :angmom2_y
title --> "Orbital Angular Momentum (Y)"
yguide --> L"L_y" * " (arb. units)"
label --> "OAM around Ge"
for angmom in band.angmoms
push!(out, angmom[2][2])
end
elseif data == :angmom2_z
title --> "Orbital Angular Momentum (Z)"
yguide --> "Lz (arb. units)"
label --> "OAM around Ge"
for angmom in band.angmoms
push!(out, angmom[2][3])
end
elseif data == :angmom2_xy
title --> "Orbital Angular Momentum (XY)"
yguide --> "norm(Lx)+norm(Ly)"
label --> "Total angmom"
for (spin, angmom) in zip(band.spins, band.angmoms)
push!(out,
sqrt((angmom[2][1] + spin[2][1])^2 + (angmom[2][2] + spin[2][2])^2))
end
elseif data == :spin1_x
title --> "Spin Angular Momentum (X)"
yguide --> "Sx (arb. units)"
label --> "SAM around Ge"
for spin in band.spins
push!(out, spin[1][1])
end
elseif data == :spin1_y
title --> "Spin Angular Momentum (Y)"
yguide --> "Sy (arb. units)"
label --> "SAM around Ge"
for spin in band.spins
push!(out, spin[1][2])
end
elseif data == :spin1_z
title --> "Spin Angular Momentum (Z)"
yguide --> "Sz (arb. units)"
label --> "SAM around Ge"
for spin in band.spins
push!(out, spin[1][3])
end
elseif data == :spin2_x
title --> "Spin Angular Momentum (X)"
yguide --> L"S_x" * " (arb. units)"
label --> "SAM around Te"
for spin in band.spins
push!(out, spin[2][1])
end
elseif data == :spin2_y
title --> "Spin Angular Momentum (Y)"
yguide --> L"S_y" * " (arb. units)"
label --> "SAM around Te"
for spin in band.spins
push!(out, spin[2][2])
end
elseif data == :spin2_z
title --> "Spin Angular Momentum (Z)"
yguide --> "Sz (arb. units)"
label --> "SAM around Te"
for spin in band.spins
push!(out, spin[2][3])
end
elseif data == :epot
title --> "Electrostatic Potential"
yguide --> "E (arb. units)"
for epot in band.epots
push!(out, epot)
end
end
end
legend --> false
return ks, out
end
@recipe function f(bands::Array{<:WannierBand,1}, data::Array{Symbol,1})
layout := length(data)
for (i, dat) in enumerate(data)
@series begin
subplot := i
bands, data[i]
end
end
end
@recipe function f(bands::Array{<:WannierBand,1}, data::Symbol)
for band in bands
@series begin
band, data
end
end
end
@recipe function f(bands::Array{<:WannierBand,1})
for band in bands
@series begin
band
end
end
end
@recipe function f(dfbands::Array{DFC.Band,1}, WannierBands::Array{<:WannierBand,1})
@series begin
label --> "DFT Calculation"
line --> (1, 1.0, :blue)
dfbands[1]
end
@series begin
label --> "Wannier Interpolation"
line --> (2, :dot, 1.0, :red)
WannierBands[1], :eigvals
end
for band in dfbands[2:end]
@series begin
label --> ""
line --> (1, 1.0, :blue)
band
end
end
for band in WannierBands[2:end]
@series begin
label --> ""
line --> (2, :dot, 1.0, :red)
band, :eigvals
end
end
end
@recipe function f(WannierBands::Array{<:WannierBand,1}, dfbands::Array{DFC.Band,1})
@series begin
dfbands, WannierBands
end
end
| DFWannier | https://github.com/louisponet/DFWannier.jl.git |
Subsets and Splits