source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/real.rb | Ruby | mit | 99 | master | 516 | module Fog
module Google
class DNS
class Real
include Fog::Google::Shared
attr_reader :dns
def initialize(options)
shared_initialize(options[:google_project], GOOGLE_DNS_API_VERSION, GOOGLE_DNS_BASE_URL)
options[:google_api_scope_url] = GOOGLE_DNS_API_SCOPE_URLS... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/mock.rb | Ruby | mit | 99 | master | 706 | module Fog
module Google
class DNS
class Mock
include Fog::Google::Shared
def initialize(options)
shared_initialize(options[:google_project], GOOGLE_DNS_API_VERSION, GOOGLE_DNS_BASE_URL)
end
def self.data(_api_version)
@data ||= {}
end
d... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/get_project.rb | Ruby | mit | 99 | master | 593 | module Fog
module Google
class DNS
##
# Fetches the representation of an existing Project. Use this method to look up the limits on the number of
# resources that are associated with your project.
#
# @see https://developers.google.com/cloud-dns/api/v1/projects/get
class Real
... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/get_managed_zone.rb | Ruby | mit | 99 | master | 521 | module Fog
module Google
class DNS
##
# Fetches the representation of an existing Managed Zone.
#
# @see https://developers.google.com/cloud-dns/api/v1/managedZones/get
class Real
def get_managed_zone(name_or_id)
@dns.get_managed_zone(@project, name_or_id)
e... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/list_changes.rb | Ruby | mit | 99 | master | 775 | module Fog
module Google
class DNS
##
# Enumerates the list of Changes.
#
# @see https://developers.google.com/cloud-dns/api/v1/changes/list
class Real
def list_changes(zone_name_or_id, max_results: nil, page_token: nil,
sort_by: nil, sort_order: nil)... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/list_managed_zones.rb | Ruby | mit | 99 | master | 748 | module Fog
module Google
class DNS
##
# Enumerates Managed Zones that have been created but not yet deleted.
#
# @see hhttps://developers.google.com/cloud-dns/api/v1/managedZones/list
class Real
def list_managed_zones(dns_name: nil, max_results: nil, page_token: nil)
... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/list_resource_record_sets.rb | Ruby | mit | 99 | master | 858 | module Fog
module Google
class DNS
##
# Enumerates Resource Record Sets that have been created but not yet deleted.
#
# @see https://developers.google.com/cloud-dns/api/v1/resourceRecordSets/list
class Real
def list_resource_record_sets(zone_name_or_id, max_results: nil,
... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/get_change.rb | Ruby | mit | 99 | master | 538 | module Fog
module Google
class DNS
##
# Fetches the representation of an existing Change.
#
# @see https://developers.google.com/cloud-dns/api/v1/changes/get
class Real
def get_change(zone_name_or_id, identity)
@dns.get_change(@project, zone_name_or_id, identity)
... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/create_change.rb | Ruby | mit | 99 | master | 732 | module Fog
module Google
class DNS
##
# Atomically updates a ResourceRecordSet collection.
#
# @see https://cloud.google.com/dns/api/v1/changes/create
class Real
def create_change(zone_name_or_id, additions = [], deletions = [])
@dns.create_change(
@proj... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/delete_managed_zone.rb | Ruby | mit | 99 | master | 520 | module Fog
module Google
class DNS
##
# Deletes a previously created Managed Zone.
#
# @see https://developers.google.com/cloud-dns/api/v1/managedZones/delete
class Real
def delete_managed_zone(name_or_id)
@dns.delete_managed_zone(@project, name_or_id)
end
... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/requests/create_managed_zone.rb | Ruby | mit | 99 | master | 735 | require "date"
module Fog
module Google
class DNS
##
# Creates a new Managed Zone.
#
# @see https://developers.google.com/cloud-dns/api/v1/managedZones/create
class Real
def create_managed_zone(name, dns_name, description)
mngd_zone = ::Google::Apis::DnsV1::ManagedZ... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/models/change.rb | Ruby | mit | 99 | master | 929 | module Fog
module Google
class DNS
##
# Represents a Change resource
#
# @see https://developers.google.com/cloud-dns/api/v1/changes
class Change < Fog::Model
identity :id
attribute :kind
attribute :start_time, :aliases => "startTime"
attribute :statu... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/models/record.rb | Ruby | mit | 99 | master | 3,367 | module Fog
module Google
class DNS
##
# Resource Record Sets resource
#
# @see https://cloud.google.com/dns/api/v1/resourceRecordSets
class Record < Fog::Model
identity :name
attribute :kind
attribute :type
attribute :ttl
attribute :rrdatas
... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/models/changes.rb | Ruby | mit | 99 | master | 1,296 | module Fog
module Google
class DNS
class Changes < Fog::Collection
model Fog::Google::DNS::Change
attribute :zone
##
# Enumerates the list of Changes
#
# @return [Array<Fog::Google::DNS::Change>] List of Changes resources
def all
requires :... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/models/records.rb | Ruby | mit | 99 | master | 1,594 | module Fog
module Google
class DNS
class Records < Fog::Collection
model Fog::Google::DNS::Record
attribute :zone
##
# Enumerates Resource Record Sets that have been created but not yet deleted
#
# @return [Array<Fog::Google::DNS::Record>] List of Resource R... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/models/project.rb | Ruby | mit | 99 | master | 2,559 | module Fog
module Google
class DNS
##
# Represents a Project resource
#
# @see https://developers.google.com/cloud-dns/api/v1/projects
class Project < Fog::Model
identity :id
attribute :kind
attribute :number
attribute :quota
# These attribut... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/models/zone.rb | Ruby | mit | 99 | master | 2,003 | module Fog
module Google
class DNS
##
# Managed Zone resource
#
# @see https://developers.google.com/cloud-dns/api/v1/managedZones
class Zone < Fog::Model
identity :id
attribute :creation_time, :aliases => "creationTime"
attribute :description
attribu... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/models/zones.rb | Ruby | mit | 99 | master | 907 | module Fog
module Google
class DNS
class Zones < Fog::Collection
model Fog::Google::DNS::Zone
##
# Enumerates Managed Zones that have been created but not yet deleted
#
# @return [Array<Fog::Google::DNS::Zone>] List of Managed Zone resources
def all
... |
github | fog/fog-google | https://github.com/fog/fog-google | lib/fog/google/dns/models/projects.rb | Ruby | mit | 99 | master | 588 | module Fog
module Google
class DNS
class Projects < Fog::Collection
model Fog::Google::DNS::Project
##
# Fetches the representation of an existing Project
#
# @param [String] identity Project identity
# @return [Fog::Google::DNS::Project] Project resource
... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/storage.rb | Ruby | mit | 99 | master | 1,486 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
# This spe... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/l7_load_balance.rb | Ruby | mit | 99 | master | 3,028 | # This example assumes three instances have been created in the project.
# They should each have Apache installed and distinct index.html files
# in order to observe the results of the l7 load balancer. A firewall
# rule should also have been created with a tag shared by the instances.
# More info on Google's HTTP load... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/metadata.rb | Ruby | mit | 99 | master | 1,100 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def test
... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/storage_json.rb | Ruby | mit | 99 | master | 1,202 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
# This spe... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/get_list_images.rb | Ruby | mit | 99 | master | 1,568 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def test
... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/create_instance_with_attached_disk.rb | Ruby | mit | 99 | master | 1,745 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
def example
p "Connecting to Google API"
connection = Fog::Compute.new(:provider => "Google")
p "Creatin... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/image_create.rb | Ruby | mit | 99 | master | 593 | def test
connection = Fog::Compute.new(:provider => "Google")
rawdisk = {
# Google Cloud Storage URL pointing to the disk image. (e.g. http://storage.googleapis.com/test/test.tar.gz)
:source => nil,
:container_type => "TAR"
}
# Can't test this unless the 'source' points to a valid URL
return if ... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/get_list_snapshots.rb | Ruby | mit | 99 | master | 828 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def test
... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/create_instance.rb | Ruby | mit | 99 | master | 2,310 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
def example
p "Connecting to Google API"
connection = Fog::Compute.new(:provider => "Google")
p "Creatin... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/network.rb | Ruby | mit | 99 | master | 1,670 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def test
... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/create_instance_and_attach_disk_later.rb | Ruby | mit | 99 | master | 2,911 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
ZONE = "us-central1-f"
PROJECT = Fog.credentials[:google_project]
def example
p "Connecting to Google API"
... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/load-balance.rb | Ruby | mit | 99 | master | 2,807 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def test
... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/backend_services.rb | Ruby | mit | 99 | master | 585 | require "rubygems"
require "fog"
def test
connection = Fog::Compute.new(:provider => "google")
health = connection.http_health_checks.create(:name => "test-checks")
health.wait_for { health.ready? }
backend = connection.backend_services.create(
:name => "backend-test",
:health_checks => [health.self_li... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/bootstrap.rb | Ruby | mit | 99 | master | 901 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
# Code can be ran by simply invoking `ruby bootstrap.rb`
# Note: this example will require 'net-ssh' gem to be installed
require "bundler"
Bundler.require(:default, :deve... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/precreated_client.rb | Ruby | mit | 99 | master | 743 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
# This exa... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/sql/instances.rb | Ruby | mit | 99 | master | 1,052 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
connection = Fog::Google::SQL.new
puts "Create a Instance..."
puts "--------------------"
instance = connectio... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/sql/ssl_certs.rb | Ruby | mit | 99 | master | 1,037 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
connection = Fog::Google::SQL.new
puts "Create a Instance..."
puts "--------------------"
instance = connectio... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/sql/operations.rb | Ruby | mit | 99 | master | 727 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
connection = Fog::Google::SQL.new
puts "Create a Instance..."
puts "--------------------"
instance = connectio... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/sql/flags.rb | Ruby | mit | 99 | master | 317 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
connection = Fog::Google::SQL.new
puts "Listing all Flags..."
puts "--------------------"
connection.flags |
github | fog/fog-google | https://github.com/fog/fog-google | examples/sql/tiers.rb | Ruby | mit | 99 | master | 317 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
connection = Fog::Google::SQL.new
puts "Listing all Tiers..."
puts "--------------------"
connection.tiers |
github | fog/fog-google | https://github.com/fog/fog-google | examples/dns/zones.rb | Ruby | mit | 99 | master | 1,150 | def test
connection = Fog::Google::DNS.new
puts "Create a Zone..."
puts "----------------"
zone = connection.zones.create(:name => "mytestdomain", :domain => "example.org.", :description => "This is my test domain")
puts "List all Zones..."
puts "-----------------"
connection.zones.all
puts "Get the ... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/monitoring/metric_descriptors.rb | Ruby | mit | 99 | master | 875 | # All examples presume that you have a ~/.fog credentials file set up.
# # More info on it can be found here: http://fog.io/about/getting_started.html
#
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
#
def t... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/monitoring/monitored_resource_descriptors.rb | Ruby | mit | 99 | master | 914 | # All examples presume that you have a ~/.fog credentials file set up.
# # More info on it can be found here: http://fog.io/about/getting_started.html
#
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
#
def t... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/monitoring/timeseries_collection.rb | Ruby | mit | 99 | master | 1,367 | # All examples presume that you have a ~/.fog credentials file set up.
# # More info on it can be found here: http://fog.io/about/getting_started.html
#
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def tes... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/pubsub/topics.rb | Ruby | mit | 99 | master | 871 | # All examples presume that you have a ~/.fog credentials file set up.
# # More info on it can be found here: http://fog.io/about/getting_started.html
#
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def tes... |
github | fog/fog-google | https://github.com/fog/fog-google | examples/pubsub/subscriptions.rb | Ruby | mit | 99 | master | 1,637 | # All examples presume that you have a ~/.fog credentials file set up.
# # More info on it can be found here: http://fog.io/about/getting_started.html
#
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def tes... |
github | fog/fog-google | https://github.com/fog/fog-google | tasks/test.rake | Ruby | mit | 99 | master | 3,661 | require "rake/testtask"
Rake::TestTask.new do |t|
t.description = "Run integration and unit tests"
t.libs << "test"
t.pattern = File.join("test", "**", "test_*.rb")
t.warning = false
end
namespace :test do
mock = ENV["FOG_MOCK"] || "true"
task :travis do
sh("bundle exec rake test:unit")
end
desc ... |
github | fog/fog-google | https://github.com/fog/fog-google | tasks/changelog.rake | Ruby | mit | 99 | master | 1,265 | require "fileutils"
# Helper method to insert text after a line that matches the regex
def insert_after_line(file, insert, regex = /^## Next/)
tempfile = File.open("#{file}.tmp", "w")
f = File.new(file)
f.each do |line|
tempfile << line
next unless line =~ regex
tempfile << "\n"
tempfile << inse... |
github | fog/fog-google | https://github.com/fog/fog-google | tasks/console.rake | Ruby | mit | 99 | master | 442 | # From http://erniemiller.org/2014/02/05/7-lines-every-gems-rakefile-should-have/
# with some modification.
desc "Project IRB console"
task :console do
require "bundler"
Bundler.require(:default, :development)
# Reload helper to avoid resetting the environment when debugging
def reload!
files = $LOADED_FE... |
github | fog/fog-google | https://github.com/fog/fog-google | test/helpers/client_helper.rb | Ruby | mit | 99 | master | 1,931 | ##
# Helper mixin for tests (especially compute-based ones). Provide access to the
# client in use via the #client method to use.
module ClientHelper
# Check to see if an compute operation is finished.
#
# @param op [Google::Apis::ComputeV1::Operation] the operation object returned from an api call
# @return [... |
github | fog/fog-google | https://github.com/fog/fog-google | test/helpers/integration_test_helper.rb | Ruby | mit | 99 | master | 4,678 | require "helpers/test_helper"
require "helpers/test_collection"
require "retriable"
# Use :test credentials in ~/.fog for live integration testing
# XXX not sure if this will work on Travis CI or not
Fog.credential = :test
# Enable test debugging, providing additional information in some methods
DEBUG = ENV['FOG_TEST... |
github | fog/fog-google | https://github.com/fog/fog-google | test/helpers/test_collection.rb | Ruby | mit | 99 | master | 2,150 | module TestCollection
# Anything that includes TestCollection must, during setup, assign @subject and @factory, where
# @subject is the collection under test, (e.g. Fog::Compute[:google].servers)
# @factory is a CollectionFactory
def test_lifecycle
one = @subject.new(@factory.params)
one.save
t... |
github | fog/fog-google | https://github.com/fog/fog-google | test/helpers/test_helper.rb | Ruby | mit | 99 | master | 895 | # Configure simplecov for coverage tests
# Note: needs to be done _before_ requiring minitest!
if ENV["COVERAGE"]
require "simplecov"
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
SimpleCov.skip_token('no-coverage')
SimpleCov.start do
add_filter "/test/"
end
end
# The next lin... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/test_authentication.rb | Ruby | mit | 99 | master | 1,668 | require "helpers/integration_test_helper"
# TODO: this is a port over from legacy tests. It shouldn't be scoped under Google, but under Google::Shared.
class TestAuthentication < FogIntegrationTest
def setup
@google_json_key_location = Fog.credentials[:google_json_key_location]
@google_json_key_string = Fil... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/pubsub/test_pubsub_requests.rb | Ruby | mit | 99 | master | 3,320 | require "helpers/integration_test_helper"
require "integration/pubsub/pubsub_shared"
require "securerandom"
require "base64"
class TestPubsubRequests < PubSubShared
def test_create_topic
name = new_topic_name
result = @client.create_topic(name)
assert_equal(result.name, name)
end
def test_get_topic
... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/pubsub/test_coverage.rb | Ruby | mit | 99 | master | 279 | require "helpers/integration_test_helper"
# This is a simple coverage helper that helps differentiate
# the tests when run in parallel so the final coverage report
# can be properly combined together from multiple runners
SimpleCov.command_name "test:pubsub" if ENV["COVERAGE"] |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/pubsub/pubsub_shared.rb | Ruby | mit | 99 | master | 2,449 | require "helpers/integration_test_helper"
require "securerandom"
require "base64"
class PubSubShared < FogIntegrationTest
def setup
@client = Fog::Google::Pubsub.new
# Ensure any resources we create with test prefixes are removed
Minitest.after_run do
delete_test_resources
end
end
def dele... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/pubsub/test_pubsub_models.rb | Ruby | mit | 99 | master | 4,514 | require "helpers/integration_test_helper"
require "integration/pubsub/pubsub_shared"
require "securerandom"
require "base64"
class TestPubsubModels < PubSubShared
def test_topics_create
name = new_topic_name
result = @client.topics.create(:name => name)
assert_equal(result.name, name)
end
def test_t... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/sql/test_common_tiers.rb | Ruby | mit | 99 | master | 744 | require "helpers/integration_test_helper"
class TestCommonTiers < FogIntegrationTest
def setup
@subject = Fog::Google[:sql].tiers
end
def test_all
tiers = @subject.all
assert_operator(tiers.size, :>, 0,
"tier count should be positive")
_sanity_check_tier(tiers.first)
end
... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/sql/test_common_flags.rb | Ruby | mit | 99 | master | 763 | require "helpers/integration_test_helper"
class TestCommonFlags < FogIntegrationTest
def setup
@client = Fog::Google::SQL.new
end
def test_list
resp = @client.list_flags
assert_operator(resp.items.size, :>, 0,
"resource descriptor count should be positive")
_sanity_check_fl... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/sql/test_instances.rb | Ruby | mit | 99 | master | 3,215 | require "helpers/integration_test_helper"
require "integration/factories/sql_instances_factory"
# Client helper is imported for `wait_until_complete`
# TODO: Remove when fog-google#339 or fog-google#340 is resolved
require "helpers/client_helper"
class TestSQLV2Instances < FogIntegrationTest
include TestCollection
... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/sql/test_certs.rb | Ruby | mit | 99 | master | 1,616 | require "helpers/integration_test_helper"
require "integration/factories/sql_certs_factory"
class TestSQLCerts < FogIntegrationTest
# This test doesn't include TestCollection as certs are not an independent resource.
def setup
@subject = Fog::Google[:sql].ssl_certs
@factory = SqlCertsFactory.new(namespace... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/sql/test_users.rb | Ruby | mit | 99 | master | 1,101 | require "helpers/integration_test_helper"
require "integration/factories/sql_instances_factory"
require "integration/factories/sql_users_factory"
class TestSQLUsers < FogIntegrationTest
# This test doesn't include TestCollection as Users is not a
# classical Fog model, as it's tied to a particular instance
# I.e... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/sql/test_coverage.rb | Ruby | mit | 99 | master | 276 | require "helpers/integration_test_helper"
# This is a simple coverage helper that helps differentiate
# the tests when run in parallel so the final coverage report
# can be properly combined together from multiple runners
SimpleCov.command_name "test:sql" if ENV["COVERAGE"] |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/instance_groups/test_instance_groups.rb | Ruby | mit | 99 | master | 304 | require "helpers/integration_test_helper"
require "integration/factories/instance_groups_factory"
class TestInstanceGroups < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].instance_groups
@factory = InstanceGroupsFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/instance_groups/test_coverage.rb | Ruby | mit | 99 | master | 296 | require "helpers/integration_test_helper"
# This is a simple coverage helper that helps differentiate
# the tests when run in parallel so the final coverage report
# can be properly combined together from multiple runners
SimpleCov.command_name "test:compute-instance_groups" if ENV["COVERAGE"] |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/instance_groups/test_instance_templates.rb | Ruby | mit | 99 | master | 314 | require "helpers/integration_test_helper"
require "integration/factories/instance_template_factory"
class TestInstanceTemplates < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].instance_templates
@factory = InstanceTemplateFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/instance_groups/test_instance_group_managers.rb | Ruby | mit | 99 | master | 332 | require "helpers/integration_test_helper"
require "integration/factories/instance_group_manager_factory"
class TestInstanceGroupManagers < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].instance_group_managers
@factory = InstanceGroupManagerFactory.new(namespaced_name... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_servers.rb | Ruby | mit | 99 | master | 8,270 | require "helpers/integration_test_helper"
require "integration/factories/servers_factory"
require "integration/factories/disks_factory"
require "resolv"
class TestServers < FogIntegrationTest
include TestCollection
# Cleanup is handled by TestCollection
def setup
@subject = Fog::Compute[:google].servers
... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_client_options.rb | Ruby | mit | 99 | master | 473 | require "helpers/integration_test_helper"
class TestComputeClient < FogIntegrationTest
def test_client_options
# XXX This is a very rudimentary test checking that proxy option is applied
client_options = { proxy_url: "https://user:password@host:8080" }
connection = Fog::Google::Compute.new(google_client_... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_disk_types.rb | Ruby | mit | 99 | master | 1,378 | require "helpers/integration_test_helper"
class TestDiskTypes < FogIntegrationTest
NAMES = %w(local-ssd pd-ssd pd-standard).freeze
# Testing in one random zone per region (region list as of May 2018)
ZONES = %w(asia-east1-a asia-northeast1-b asia-south1-c asia-southeast1-a australia-southeast1-b
eur... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_disks.rb | Ruby | mit | 99 | master | 2,034 | require "helpers/integration_test_helper"
require "integration/factories/disks_factory"
class TestDisks < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].disks
@factory = DisksFactory.new(namespaced_name)
end
def test_create_small
disk_config = {:size_gb => 10... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_operations.rb | Ruby | mit | 99 | master | 1,312 | require "helpers/integration_test_helper"
class TestOperations < FogIntegrationTest
def setup
@subject = Fog::Compute[:google].operations
end
def test_all
# TODO: what if this test runs first on a brand new project?
assert_operator(@subject.all.size, :>=, 2,
"There should be at l... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_coverage.rb | Ruby | mit | 99 | master | 293 | require "helpers/integration_test_helper"
# This is a simple coverage helper that helps differentiate
# the tests when run in parallel so the final coverage report
# can be properly combined together from multiple runners
SimpleCov.command_name "test:compute-core_compute" if ENV["COVERAGE"] |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_regions.rb | Ruby | mit | 99 | master | 673 | require "helpers/integration_test_helper"
class TestRegions < FogIntegrationTest
EXAMPLE_NAMES = %w(asia-east1 asia-northeast1 europe-west1 us-central1 us-east1 us-west1).freeze
def setup
@subject = Fog::Compute[:google].regions
end
def test_all
assert_operator(@subject.all.size, :>=, EXAMPLE_NAMES.s... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_images.rb | Ruby | mit | 99 | master | 1,083 | require "helpers/integration_test_helper"
require "integration/factories/images_factory"
class TestImages < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].images
@factory = ImagesFactory.new(namespaced_name)
end
def test_get_specific_image
image = @subject.ge... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_projects.rb | Ruby | mit | 99 | master | 344 | require "helpers/integration_test_helper"
class TestProjects < FogIntegrationTest
def setup
@subject = Fog::Compute[:google].projects
end
def test_get
assert @subject.get(TEST_PROJECT)
end
def test_bad_get
assert_nil @subject.get("bad-name")
end
def test_enumerable
assert_respond_to @s... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_zones.rb | Ruby | mit | 99 | master | 1,116 | require "helpers/integration_test_helper"
class TestZones < FogIntegrationTest
# Testing one random zone per region (list last updated May 2018)
ZONES = %w(asia-east1-a asia-northeast1-b asia-south1-c asia-southeast1-a
australia-southeast1-b europe-west1-c europe-west2-a europe-west3-b
eu... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_machine_types.rb | Ruby | mit | 99 | master | 1,913 | require "helpers/integration_test_helper"
class TestMachineTypes < FogIntegrationTest
# List of machine types - not a complete sampling since beefier ones do not
# exist in all zones (list last updated June 2018)
NAMES = %w(f1-micro g1-small n1-highcpu-16 n1-highcpu-2 n1-highcpu-4
n1-highcpu-8 n1-hi... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_compute/test_snapshots.rb | Ruby | mit | 99 | master | 455 | require "helpers/integration_test_helper"
require "securerandom"
require "base64"
class TestComputeSnapshots < FogIntegrationTest
def setup
@client = Fog::Google::Compute.new
# Ensure any resources we create with test prefixes are removed
Minitest.after_run do
delete_test_resources
end
end
... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_networking/test_subnetworks.rb | Ruby | mit | 99 | master | 290 | require "helpers/integration_test_helper"
require "integration/factories/subnetworks_factory"
class TestSubnetworks < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].subnetworks
@factory = SubnetworksFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_networking/test_routes.rb | Ruby | mit | 99 | master | 559 | require "helpers/integration_test_helper"
class TestRoutes < FogIntegrationTest
def setup
@subject = Fog::Compute[:google].routes
end
def test_all
assert_operator(@subject.all.size, :>=, 2,
"Number of all routes should be greater or equal than 2 - default GW and default routes")
en... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_networking/test_networks.rb | Ruby | mit | 99 | master | 791 | require "helpers/integration_test_helper"
require "integration/factories/networks_factory"
require "integration/factories/servers_factory"
class TestNetworks < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].networks
@servers = ServersFactory.new(namespaced_name)
@... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_networking/test_coverage.rb | Ruby | mit | 99 | master | 296 | require "helpers/integration_test_helper"
# This is a simple coverage helper that helps differentiate
# the tests when run in parallel so the final coverage report
# can be properly combined together from multiple runners
SimpleCov.command_name "test:compute-core_networking" if ENV["COVERAGE"] |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_networking/test_firewalls.rb | Ruby | mit | 99 | master | 282 | require "helpers/integration_test_helper"
require "integration/factories/firewalls_factory"
class TestFirewalls < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].firewalls
@factory = FirewallsFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/core_networking/test_addresses.rb | Ruby | mit | 99 | master | 3,061 | require "helpers/integration_test_helper"
require "integration/factories/addresses_factory"
require "integration/factories/servers_factory"
class TestAddresses < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].addresses
@servers = ServersFactory.new(namespaced_name)
... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_global_forwarding_rules.rb | Ruby | mit | 99 | master | 334 | require "helpers/integration_test_helper"
require "integration/factories/global_forwarding_rules_factory"
class TestGlobalForwardingRules < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].global_forwarding_rules
@factory = GlobalForwardingRulesFactory.new(namespaced_na... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_forwarding_rules.rb | Ruby | mit | 99 | master | 308 | require "helpers/integration_test_helper"
require "integration/factories/forwarding_rules_factory"
class TestForwardingRules < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].forwarding_rules
@factory = ForwardingRulesFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_target_https_proxies.rb | Ruby | mit | 99 | master | 322 | require "helpers/integration_test_helper"
require "integration/factories/target_https_proxies_factory"
class TestTargetHttpsProxies < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].target_https_proxies
@factory = TargetHttpsProxiesFactory.new(namespaced_name)
end
en... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_backend_services.rb | Ruby | mit | 99 | master | 308 | require "helpers/integration_test_helper"
require "integration/factories/backend_services_factory"
class TestBackendServices < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].backend_services
@factory = BackendServicesFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_target_http_proxies.rb | Ruby | mit | 99 | master | 318 | require "helpers/integration_test_helper"
require "integration/factories/target_http_proxies_factory"
class TestTargetHttpProxies < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].target_http_proxies
@factory = TargetHttpProxiesFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_http_health_checks.rb | Ruby | mit | 99 | master | 314 | require "helpers/integration_test_helper"
require "integration/factories/http_health_checks_factory"
class TestHttpHealthChecks < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].http_health_checks
@factory = HttpHealthChecksFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_global_addresses.rb | Ruby | mit | 99 | master | 308 | require "helpers/integration_test_helper"
require "integration/factories/global_addresses_factory"
class TestGlobalAddresses < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].global_addresses
@factory = GlobalAddressesFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_coverage.rb | Ruby | mit | 99 | master | 294 | require "helpers/integration_test_helper"
# This is a simple coverage helper that helps differentiate
# the tests when run in parallel so the final coverage report
# can be properly combined together from multiple runners
SimpleCov.command_name "test:compute-loadbalancing" if ENV["COVERAGE"] |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_url_maps.rb | Ruby | mit | 99 | master | 276 | require "helpers/integration_test_helper"
require "integration/factories/url_maps_factory"
class TestUrlMaps < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].url_maps
@factory = UrlMapsFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_target_instances.rb | Ruby | mit | 99 | master | 308 | require "helpers/integration_test_helper"
require "integration/factories/target_instances_factory"
class TestTargetInstances < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].target_instances
@factory = TargetInstancesFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_target_pools.rb | Ruby | mit | 99 | master | 2,162 | require "helpers/integration_test_helper"
require "integration/factories/target_pools_factory"
class TestTargetPools < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].target_pools
@factory = TargetPoolsFactory.new(namespaced_name)
@servers = Fog::Compute[:google].s... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/compute/loadbalancing/test_ssl_certificates.rb | Ruby | mit | 99 | master | 308 | require "helpers/integration_test_helper"
require "integration/factories/ssl_certificates_factory"
class TestSslCertificates < FogIntegrationTest
include TestCollection
def setup
@subject = Fog::Compute[:google].ssl_certificates
@factory = SslCertificatesFactory.new(namespaced_name)
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/factories/networks_factory.rb | Ruby | mit | 99 | master | 282 | require "integration/factories/collection_factory"
class NetworksFactory < CollectionFactory
def initialize(example)
super(Fog::Compute[:google].networks, example)
end
def params
{
:name => resource_name,
:auto_create_subnetworks => true
}
end
end |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/factories/subnetworks_factory.rb | Ruby | mit | 99 | master | 719 | require "integration/factories/collection_factory"
class SubnetworksFactory < CollectionFactory
def initialize(example)
# We cannot have 2 subnetworks with the same CIDR range so instantiating a
# class variable holding a generator, ensuring that the factory gives us a
# new subnet every time it's called... |
github | fog/fog-google | https://github.com/fog/fog-google | test/integration/factories/addresses_factory.rb | Ruby | mit | 99 | master | 386 | require "integration/factories/collection_factory"
class AddressesFactory < CollectionFactory
def initialize(example)
super(Fog::Compute[:google].addresses, example)
end
def get(identity)
@subject.get(identity, TEST_REGION)
end
def all
@subject.all(region: TEST_REGION)
end
def params
{... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.