view release on metacpan or search on metacpan
instead of doing it longhand
0.03 2018-01-29
[!!BREAKING CHANGES!!]
- major re-arrangement of the internals for building
a stream, there is no longer an endpoint called
`stream` which you must call before things are
usable, instead things are just always usable.
- removed the `stream` method from `Directory::Scanner`
- moved all the builder methods from `Directory::Scanner`
to `Directory::Scanner::API::Stream` instead, so that
view all matches for this distribution
view release on metacpan or search on metacpan
azure-pipelines.yml view on Meta::CPAN
resources:
repositories:
- repository: ci-perl-helpers
type: github
name: houseabsolute/ci-perl-helpers
endpoint: houseabsolute
stages:
- template: templates/helpers/build.yml@ci-perl-helpers
parameters:
debug: true
view all matches for this distribution
view release on metacpan or search on metacpan
dist_zilla_docker_api_plugin_plan.md view on Meta::CPAN
$client->remote_tag_exists($image_ref); # optional registry helper
```
### `...::Progress`
Docker build/push endpoints return streaming progress records. The plugin should parse these and forward:
```text
stream/status/progress -> log_debug or log
errorDetail/error -> log_fatal
aux.ID -> captured image ID
view all matches for this distribution
view release on metacpan or search on metacpan
bin/createrelease.pl view on Meta::CPAN
generate_release_notes => $github_notes,
}
);
die "Unable to create release for $identity{login}\\$releases->{repo}" if ($response->code eq '404');
#die "Validation failed, or the endpoint has been spammed." if ($response->code eq '422');
die "login or token invalid for the specified repository: $identity{login}\\$releases->{repo}\n"
if ($response->code eq '403');
if ($response->code ne '201') {
my $message = $response->raw_content();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pod/Weaver/PluginBundle/Author/GETTY.pm view on Meta::CPAN
Parse a configuration file and return a hashref.
=head2 =resource
Documents available resources, features, or API endpoints.
=resource servers
Cloud servers (create, delete, power on/off)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Docker/Client.pm view on Meta::CPAN
our $VERSION = '0.1.1';
class_type 'Mojo::URL';
coerce 'Mojo::URL', from 'Str', via { Mojo::URL->new(shift) };
has 'endpoint' => (
is => 'ro',
isa => 'Mojo::URL',
default => sub {
return Mojo::URL->new('http+unix://%2Fvar%2Frun%2Fdocker.sock');
},
lib/Docker/Client.pm view on Meta::CPAN
default => sub {
my $self = shift;
## Making sure we use the correct version path
my $base_url =
$self->endpoint()->clone()->path( sprintf '/%s', $self->version() );
## Loading correct version specification from disk.
my $spec =
Mojo::File->new( dist_dir('Docker-Client') )->child('specs')
->child( sprintf '%s.yaml', $self->version() );
## Creating the OpenAPI Client instance using the defined parameters.
my $api =
OpenAPI::Client->new( $spec->to_string(),
base_url => $self->endpoint() );
## If the protocol is local we need to replace the "Host" header on each request
if ( $self->endpoint()->protocol() eq 'http+unix' ) {
$api->ua()->on(
start => sub {
my ( $ua, $tx ) = @_;
$tx->req()->headers()->header( 'Host' => 'localhost' );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Docker/Registry/Auth/Gitlab.pm view on Meta::CPAN
The repository you request access to.
=head2 jwt
The endpoint to request the JWT token from, defaults to
'https://gitlab.com/jwt/auth'. You can use a 'Str' or an URI object.
=head1 METHODS
=head2 get_bearer_token
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dubber/API.pm view on Meta::CPAN
);
method _build_json_coder () { return Cpanel::JSON::XS->new->utf8; }
# ------------------------------------------------------------------------
has endpoints => (
is => 'ro',
default => sub {
{ root => { path => '/' },
# Group Methods (Group Authentication Required)
lib/Dubber/API.pm view on Meta::CPAN
};
},
);
method commands () { return $self->endpoints; }
# ------------------------------------------------------------------------
method upload_recording_mp3_file ($account_id, $call_metadata, $mp3_file_or_data) {
my @data_parts = $self->_split_recording_data($mp3_file_or_data);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ELab/Client.pm view on Meta::CPAN
is => 'ro',
isa => 'Str',
required => 1,
);
has endpoint => (
is => 'ro',
isa => 'Str',
default => 'api/v1/'
);
lib/ELab/Client.pm view on Meta::CPAN
my (%args) = validated_hash(
\@_,
file => { isa => 'Str' },
);
my $request = HTTP::Request::Common::POST(
$self->host().$self->endpoint()."experiments/$id",
{
file => [ $args{file} ]
},
Content_Type => 'form-data',
Authorization => $self->token(),
lib/ELab/Client.pm view on Meta::CPAN
my (%args) = validated_hash(
\@_,
file => { isa => 'Str' },
);
my $request = HTTP::Request::Common::POST(
$self->host().$self->endpoint()."items/$id",
{
file => [ $args{file} ]
},
Content_Type => 'form-data',
Authorization => $self->token(),
lib/ELab/Client.pm view on Meta::CPAN
sub elab_get {
my $self = shift;
my $url = shift;
my $result = $self->GET($self->endpoint().$url);
return undef unless $result->responseCode() eq '200';
return $result->responseContent();
}
sub elab_delete {
my $self = shift;
my $url = shift;
my $result = $self->DELETE($self->endpoint().$url);
return undef unless $result->responseCode() eq '200';
return $result->responseContent();
}
lib/ELab/Client.pm view on Meta::CPAN
my $self = shift;
my $url = shift;
my $data = shift;
$data =~ s/^\?//; # buildQuery starts with "?" (makes no sense here)
my $headers = { 'Content-Type' => 'application/x-www-form-urlencoded' };
my $result = $self->POST($self->endpoint().$url, $data, $headers);
return undef unless $result->responseCode() eq '200';
return $result->responseContent();
}
view all matches for this distribution
view release on metacpan or search on metacpan
script/ecs_amqp_recv.py view on Meta::CPAN
# Influenced by solace-samples-amqp-qpid-proton-python and cli-proton-python:
# https://github.com/SolaceSamples/solace-samples-amqp-qpid-proton-python
# https://github.com/rh-messaging/cli-proton-python
#
# Qpid Proton Python is dependent on the Qpid Proton C API. E.g., Receiver.flow(n):
# https://qpid.apache.org/releases/qpid-proton-0.37.0/proton/python/docs/_modules/proton/_endpoints.html
# https://qpid.apache.org/releases/qpid-proton-0.37.0/proton/c/api/group__link.html
#
# The Red Hat Qpid Python documentation may also be informative:
# https://docs.redhat.com/en/documentation/red_hat_build_of_apache_qpid_proton_python/0.40/html/using_qpid_python/index
#
view all matches for this distribution
view release on metacpan or search on metacpan
bin/epfl-net-ssl-test view on Meta::CPAN
while ( not $host = $labs->analyze( host => $domain )->complete() ) {
sleep $labs->previous_eta();
}
if ( $host->ready() ) {
foreach my $endpoint ( $host->endpoints() ) {
if ( $endpoint->ready() ) {
print "\n", $endpoint->ip_address(), "\n"
or croak "Couldn't write: $OS_ERROR";
print color('green'), 'â Diode', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
print color('green'), 'â SSL Certificate', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
if ( $endpoint->grade() eq 'A' or $endpoint->grade() eq 'A+' ) {
print color('green'), 'â Grade ', $endpoint->grade(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
}
else {
print color('red'), 'â Grade ', $endpoint->grade(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
}
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
#!/usr/bin/env perl
# TLS connection â connect over a TLS-fronted ClickHouse port.
#
# Set up a TLS endpoint (e.g. with stunnel or nginx) and point this script
# at it via CLICKHOUSE_TLS_HOST / CLICKHOUSE_TLS_PORT.
use strict;
use warnings;
use EV;
use EV::ClickHouse;
view all matches for this distribution
view release on metacpan or search on metacpan
use EV::Etcd;
# Check if etcd is running
my $etcd_running = 0;
eval {
my $result = `etcdctl endpoint health 2>&1`;
$etcd_running = 1 if $result =~ /is healthy/;
};
die "etcd not running\n" unless $etcd_running;
my $client = EV::Etcd->new(
endpoints => ['127.0.0.1:2379'],
);
my $prefix = "/bench_$$";
my $iterations = $ENV{BENCH_ITER} || 1000;
view all matches for this distribution
view release on metacpan or search on metacpan
eg/etcd_series.pl view on Meta::CPAN
use feature 'say';
# Initialize Etcd client
# Note: Ensure etcd is running on localhost:2379
my $etcd = EV::Etcd->new(
endpoints => ['127.0.0.1:2379'],
);
my @steps = (
{ key => '/config/step1', val => 'init' },
{ key => '/config/step2', val => 'processing' },
view all matches for this distribution
view release on metacpan or search on metacpan
deps/hiredis/README.md view on Meta::CPAN
}
}
```
One can also use `redisConnectWithOptions` which takes a `redisOptions` argument
that can be configured with endpoint information as well as many different flags
to change how the `redisContext` will be configured.
```c
redisOptions opt = {0};
/* One can set the endpoint with one of our helper macros */
if (tcp) {
REDIS_OPTIONS_SET_TCP(&opt, "localhost", 6379);
} else {
REDIS_OPTIONS_SET_UNIX(&opt, "/tmp/redis.sock");
}
view all matches for this distribution
view release on metacpan or search on metacpan
eg/health_checker.pl view on Meta::CPAN
host => $ENV{NATS_HOST} // '127.0.0.1',
port => $ENV{NATS_PORT} // 4222,
on_error => sub { warn "nats: @_\n" },
on_connect => sub {
if ($mode eq 'service' || $mode eq 'both') {
# Register health endpoint
$nats->subscribe("health.$name", sub {
my ($subj, $payload, $reply) = @_;
return unless $reply;
# Simulate health: 90% healthy, 10% degraded
my $status = rand() < 0.9 ? 'healthy' : 'degraded';
$nats->publish($reply, "$name:$status:$$:" . int(rand(100)) . "ms");
});
print "service '$name' registered health endpoint\n";
if ($mode eq 'both') {
# Also register a second service for demo
$nats->subscribe("health.db", sub {
my ($subj, $payload, $reply) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
deps/hiredis/README.md view on Meta::CPAN
}
}
```
One can also use `redisConnectWithOptions` which takes a `redisOptions` argument
that can be configured with endpoint information as well as many different flags
to change how the `redisContext` will be configured.
```c
redisOptions opt = {0};
/* One can set the endpoint with one of our helper macros */
if (tcp) {
REDIS_OPTIONS_SET_TCP(&opt, "localhost", 6379);
} else {
REDIS_OPTIONS_SET_UNIX(&opt, "/tmp/redis.sock");
}
deps/hiredis/README.md view on Meta::CPAN
/* Finally various options may be set via the `options` member, as described below */
opt->options |= REDIS_OPT_PREFER_IPV4;
```
If a connection is lost, `int redisReconnect(redisContext *c)` can be used to restore the connection using the same endpoint and options as the given context.
### Configurable redisOptions flags
There are several flags you may set in the `redisOptions` struct to change default behavior. You can specify the flags via the `redisOptions->options` member.
view all matches for this distribution
view release on metacpan or search on metacpan
t/27-review-coverage.t view on Meta::CPAN
is(scalar(@during), 0, "connections() excludes a still-connecting conn");
my $to = EV::timer(10, 0, sub { diag "Timeout!"; EV::break });
EV::run;
my @after = $ctx->connections; # client + server endpoints now open
ok(scalar(@after) >= 1, "connections() includes the established conn(s)");
$keep{cli}->close(1000) if $keep{cli};
}
# 10. send_fragment binary path: binary fragments reassemble into one binary
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Eixo/Docker/Container.pm view on Meta::CPAN
action=>'attach',
method=>'POST',
host=>$self->api->client->endpoint,
args=>\%args,
url_args=>[qw(logs stream stdin stdout stderr)],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Eixo/Rest/Api.pm view on Meta::CPAN
sub DESTROY {}
sub initialize{
my ($self, $endpoint, %opts) = @_;
$self->client(
Eixo::Rest::Client->new($endpoint, %opts)
);
$self->SUPER::initialize(%opts);
$self;
view all matches for this distribution
view release on metacpan or search on metacpan
t/Elive/MockConnection.pm view on Meta::CPAN
my $self = {};
bless $self, $class;
$url ||= 'http://elive_mock_connection';
$url =~ s{/$}{}; # lose trailing '/'
$url =~ s{/webservice\.event$}{}; # lose endpoint
$url =~ s{/v[1-9]$}{}; # lose adapter path
if ($url =~ s{^(\w+)://(.*)\@}{$1://}) { # lose/capture credentials
my ($_user, $_pass) = split(':', $2, 2);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Abuse/Investigator.pm view on Meta::CPAN
$ua->env_proxy(1);
$self->{ua} = $ua;
}
# Use the ARIN RDAP endpoint; it covers the ARIN region and redirects
# for RIPE/APNIC/LACNIC/AfriNIC allocations.
my $res = eval { $ua->get("https://rdap.arin.net/registry/ip/$ip") };
return {} unless $res && $res->is_success();
my $j = $res->decoded_content();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/ExactTarget.pm view on Meta::CPAN
sub soap_call
{
my ( $self, %args ) = @_;
my $verbose = $self->verbose();
my $use_test_environment = $self->use_test_environment();
my $endpoint = $use_test_environment
? $ENDPOINT_TEST
: $ENDPOINT_LIVE;
# Check the parameters.
confess 'You must define a SOAP action'
lib/Email/ExactTarget.pm view on Meta::CPAN
$args{'arguments'} ||= [];
# Do not forget to specify the soapaction (on_action), you will find it in the
# wsdl.
# - uri is the target namespace in the wsdl
# - proxy is the endpoint address
my $soap = SOAP::Lite
->uri( $NAMESPACE )
->on_action( sub { return '"' . $args{'action'} . '"' } )
->proxy( $endpoint )
->readable( ( $verbose ? 1 : 0 ) );
# You must define the namespace used in the wsdl, as an attribute to the
# method without namespace prefix for compatibility with .NET
# (document/literal).
lib/Email/ExactTarget.pm view on Meta::CPAN
SOAP::Header
->name( Action => $args{'action'} )
->uri( 'http://schemas.xmlsoap.org/ws/2004/08/addressing' )
->prefix( 'wsa' ),
SOAP::Header
->name( To => $endpoint )
->uri( 'http://schemas.xmlsoap.org/ws/2004/08/addressing' )
->prefix( 'wsa' ),
SOAP::Header
->name(
Security => \SOAP::Data->value(
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/SendGrid/V3.pm view on Meta::CPAN
#pod =cut
sub send {
my ($self, %args) = @_;
my $api_key = $args{api_key} || $self->{api_key} or croak "API key is required to send";
my $endpoint = $args{endpoint} || $self->{endpoint} || DEFAULT_ENDPOINT;
my $payload = $self->_payload;
my $http = HTTP::Tiny->new(
keep_alive => 0,
default_headers => {
lib/Email/SendGrid/V3.pm view on Meta::CPAN
'Authorization' => "Bearer $api_key",
},
);
my $response = $http->post(
$endpoint, { content => $payload },
);
return $response;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Sender/Transport/Mailgun.pm view on Meta::CPAN
# Percent-escape anything other than alphanumeric and - _ . ~
# https://github.com/sdt/Email-Sender-Transport-Mailgun/issues/4
my $api_key = $self->_api_key;
$api_key =~ s/[^-_.~0-9a-zA-Z]/sprintf('%%%02x',ord($&))/eg;
# adapt endpoint based on region setting.
$rest =~ s/(\.mailgun)/sprintf('.%s%s', $self->region, $1)/e
if defined $self->region && $self->region ne 'us';
return "$proto://api:$api_key\@$rest/$domain";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Endoscope.pm view on Meta::CPAN
queries and view their output can read the contents of nearly any variable
present in memory. As such, access to these capabilities should be carefully
guarded.
For example, if C<Endoscope> is integrated into a web framework and exposes
a special HTTP endpoint for configuring queries, that endpoint should only be
accessible from the host where the application is running, not externally.
Additionally, that HTTP endpoint should be gated by strong
authentication/authorization.
=head1 SEE ALSO
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/benchmark.pl view on Meta::CPAN
<p>You see, <a href="https://metacpan.org">MetaCPAN</a> does not only have a pretty face,
but also has a <a href="https://github.com/CPAN-API/cpan-api/wiki/Beta-API-docs">smashing backend</a>
that can be used <a href="http://explorer.metacpan.org/">straight-up</a> for fun and
profit.</p>
<p>Accessing REST endpoints is not hard, but it's a little bit of a low-level
chore. In Perl space, there is already <a href='http://search.cpan.org/dist/MetaCPAN-API'>MetaCPAN::API</a> to
abstract</p>
<pre class="brush: perl">my $ua = LWP::UserAgent;
my $me = decode_json(
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Etcd.pm view on Meta::CPAN
Queries and returns the server version as a string.
=head1 ENDPOINTS
Individual API endpoints are implemented in separate modules. See the documentation for the following modules for more information:
=over 4
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Etcd3/Auth.pm view on Meta::CPAN
# grant role
$etcd->user_role( { user => 'samba', role => 'myrole' })->grant;
=cut
=head2 endpoint
=cut
has endpoint => (
is => 'ro',
isa => Str,
);
=head2 password
lib/Etcd3/Auth.pm view on Meta::CPAN
=cut
sub authenticate {
my ( $self, $options ) = @_;
$self->{endpoint} = '/auth/authenticate';
confess 'name and password required for ' . __PACKAGE__ . '->authenticate'
unless ($self->{password} && $self->{name});
$self->request;
return $self;
}
lib/Etcd3/Auth.pm view on Meta::CPAN
=cut
sub enable {
my ( $self, $options ) = @_;
$self->{endpoint} = '/auth/enable';
$self->{json_args} = '{}';
$self->request;
return $self;
}
lib/Etcd3/Auth.pm view on Meta::CPAN
=cut
sub disable {
my ( $self, $options ) = @_;
$self->{endpoint} = '/auth/disable';
confess 'root name and password required for ' . __PACKAGE__ . '->disable'
unless ($self->{password} && $self->{name});
$self->request;
return $self;
}
view all matches for this distribution