{"id":14988394,"url":"https://github.com/apache/karaf-jclouds","last_synced_at":"2025-08-18T19:07:52.639Z","repository":{"id":39960639,"uuid":"164282177","full_name":"apache/karaf-jclouds","owner":"apache","description":"Apache jClouds Karaf","archived":false,"fork":false,"pushed_at":"2023-12-16T09:30:00.000Z","size":1335,"stargazers_count":5,"open_issues_count":6,"forks_count":7,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-08-06T00:37:45.786Z","etag":null,"topics":["java","karaf","network-server","osgi"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-06T06:37:58.000Z","updated_at":"2023-12-16T09:30:05.000Z","dependencies_parsed_at":"2023-12-16T10:49:56.509Z","dependency_job_id":null,"html_url":"https://github.com/apache/karaf-jclouds","commit_stats":null,"previous_names":[],"tags_count":97,"template":false,"template_full_name":null,"purl":"pkg:github/apache/karaf-jclouds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-jclouds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-jclouds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-jclouds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-jclouds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/karaf-jclouds/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-jclouds/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269791814,"owners_count":24476548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","karaf","network-server","osgi"],"created_at":"2024-09-24T14:16:38.824Z","updated_at":"2025-08-18T19:07:52.589Z","avatar_url":"https://github.com/apache.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Karaf jclouds Integration\n\nThis project currently hosts a Karaf feature repository for easy installation of jclouds inside Apache Karaf. It also provides Managed Service Factories for creating Compute and BlobStore services. Last but not least it provides a rich command set for using jclouds from the Karaf shell.\n\nThere is also support for using Chef via the [jclouds Chef integration](https://jclouds.apache.org/guides/chef/).\n\nUsage Instructions\n==================\nThe instructions will make use of Amazon EC2 and S3, but can be applied to any provider or api supported by jclouds.\n\nOn Karaf 4.0.x or later:\n\nInstall jclouds AWS Modules\n---------------------------\nInstall the feature and a provider for blobstore and compute service:\n\n    karaf@root()\u003e feature:repo-add mvn:org.apache.jclouds.karaf/jclouds-karaf/2.1.0/xml/features\n    karaf@root()\u003e feature:install jclouds-aws-s3\n    karaf@root()\u003e feature:install jclouds-aws-ec2\n\n    # Install the features from jclouds-labs by adding the labs repo:\n    karaf@root()\u003e feature:repo-add mvn:org.apache.jclouds.karaf/jclouds-karaf-labs/2.1.0/xml/features\n    karaf@root()\u003e feature:install jclouds-cloudsigma2-mia\n\nInstall Karaf Commands:\n\n    karaf@root()\u003e feature:install jclouds-commands\n\nTo see the list of available jclouds modules for Karaf\n\n    karaf@root()\u003e feature:list | grep jclouds\n\nCompute Service\n---------------\nJclouds Karaf provides Managed Service Factories for ComputeService.\nThere are currently two ways of creating a compute service:\n\n* **Using the jclouds:compute-service-create command**\n* **By manually creating the configuration**\n\n**Using the jclouds:compute-service-create command**\n\nThe compute service command allows you to create a reusable compute service for a jclouds provider or api.\nTo create a compute service for the EC2 provider:\n\n    karaf@root()\u003e jclouds:compute-service-create --provider aws-ec2 --identity XXXXXX --credential XXXXXXX\n\nand for creating a compute service using an api, for example openstack:\n\n    karaf@root()\u003e jclouds:compute-service-create --api openstack-nova --endpoint XXXXXXXX --identity XXXXXX --credential XXXXXXX\n\nNote that when using apis you usually need to also specify the endpoint too. The command also supports adding extra options\nas key/value pairs. For example:\n\n    karaf@root()\u003e jclouds:compute-service-create --api openstack-nova --endpoint XXXXXXXX --identity XXXXXX --credential XXXXXXX --add-option jclouds.keystone.credential-type=passwordCredentials\n\nTo see the list of installed providers and apis or remove the service for one of the providers, you can use the jclouds:compute-service-list and jclouds-compute-service-remove commands.\n\n**Using the Karaf config commands**\n\nTo create a compute service using the Karaf's integration with the configuration admin all that needs to be done is to create a configuration with factory pid: org.jclouds.compute.\n\n    karaf@root()\u003e config:edit  org.jclouds.compute-ec2\n    karaf@root()\u003e config:property-set provider aws-ec2\n    karaf@root()\u003e config:property-set identity XXXXXXXXX\n    karaf@root()\u003e config:property-set credential XXXXXXXXX\n    karaf@root()\u003e config:property-set jclouds.ec2.ami-owners  XXXXXXXXX\n    karaf@root()\u003e config:update\n\nUse the compute service commands\n\n    karaf@root()\u003e jclouds:node-create --imageId YOUR_IMAGE_ID --locationId YOUR_LOCATION_ID GROUPNAME\n    karaf@root()\u003e jclouds:node-list.\n\nIf you don't want/need to specify specific image, you specify the os family and the os version\n\n    karaf@root()\u003e jclouds:node-create --os-family OS_FAMILY --os-version OS_VERSION --locationId YOUR_LOCATION_ID GROUPNAME\n\n**Note:** You can supply additional options to select hardware etc.\n\nRun a script to a single node or a group of nodes:\n\n    karaf@root()\u003e jclouds:group-runscript --script-url URL_OF_THE_SCRIPT GROUPNAME.\n    karaf@root()\u003e jclouds:node-runscript --script-url URL_OF_THE_SCRIPT NODEID.\n\nFor simple commands you can just inline the command, for example to get the uptime of the node:\n\n    karaf@root()\u003e jclouds:group-runscript --direct uptime GROUPNAME.\n    karaf@root()\u003e jclouds:node-runscript --direct uptime NODEID.\n\nOr you can use whatever command you want.\n\nShutdown all your nodes or the nodes of a specific group:\n\n    karaf@root()\u003e jclouds:group-destroy GROUPNAME\n    karaf@root()\u003e jclouds:node-destroy-all GROUPNAME\n\n\nBlobStore\n---------\nThere are currently two ways of creating a service for blobstore service:\n\n* **Using the jclouds:blobstore-service-create-command**\n* **By manually creating the configuration**\n\n**Using the jclouds:blobstore-service-create command**\n\nThe compute service command allows you to create and reuse blobstore service for a jclouds provider or api.\nTo create a compute service for the S3 provider:\n\n    karaf@root()\u003e jclouds:blobstore-service-create --provider aws-s3 --identity XXXXXX --credential XXXXXXX\n\nTo see the list of installed providers and apis or remove the service for one of the providers, you can use the jclouds:blobstore-service-list and jclouds-blobstore-service-remove commands.\n\n**Using the Karaf config commands**\nCreate a sample blobstore service, by using the console:\n\n    karaf@root()\u003e config:edit  org.jclouds.blobstore-s3\n    karaf@root()\u003e config:property-set provider aws-s3\n    karaf@root()\u003e config:property-set identity XXXXXXXXX\n    karaf@root()\u003e config:property-set credential XXXXXXXXX\n    karaf@root()\u003e config:update\n\nYou can use the shell commands to list, create, delete, read or write to a blob:\n\n    karaf@root()\u003e jclouds:blobstore-write BUCKET_NAME BLOB_NAME payload\n    karaf@root()\u003e jclouds:blobstore-read BUCKET_NAME BLOB_NAME\n\nThis works well for String payloads, but for binary payloads the user can use the url to be used as input or output for the commands:\n\n    karaf@root()\u003e jclouds:blobstore-write BUCKET_NAME BLOB_NAME URL_POINTING_TO_THE_PAYLOAD.\n    karaf@root()\u003e jclouds:blobstore-read BUCKET_NAME BLOB_NAME LOCAL_FILE_TO_STORE_THE_BLOB.\n\nIf the payload represents a URI the content of the URL will be written instead.\nYou can bypass this by specifying the *--store-url* and store the url as a string.\n\nBlobStore URL Handler\n---------------------\nThe commands above are useful when using the shell, but most of the time you will want the use of blobstore to be transparent.\nJclouds Karaf also provides a url handler which will allow you to use blobstore by using URLs of the following format:\n\n\u003cb\u003eblob:/PROVIDER/CONTAINER/BLOB\u003c/b\u003e\n\nChef\n----\nYou can install the chef api, with the following command:\n\n    karaf@root()\u003e feature:install jclouds-chef-api\n\nManaged Service Factories and commands are also provided for Chef. The managed service factory allows you to create a reusable service just by passing the configuration. To install the managed service factories and the chef commands, you need to install the jclouds-chef feature:\n\n    karaf@root()\u003efeature:install jclouds-chef\n\nThen you can create a chef service, using the chef:service-create command:\n\n    karaf@root()\u003e chef:service-create  --api chef --client-name CLIENT --validator-name VALIDATOR --client-key-file CLIENT.pem --validator-key-file VALIDATOR.pem --endpoint ENDPOINT\n\n**OPSCODE Chef Example:**\nThe above command for opscode chef, with client iocanel and validator iocanel-validator, the command looks like:\n\n    karaf@root()\u003e chef:service-create  --api chef --client-name iocanel --validator-name iocanel-validator --client-key-file /Users/iocanel/.chef/iocanel.pem --validator-key-file /Users/iocanel/.chef/iocanel-validator.pem --endpoint https://api.opscode.com/organizations/iocanel\n\nOnce the service has been create, you can list your cookbooks using:\n\n    karaf@root()\u003e chef:cookbook-list\n\n**Using the Chef Service with any Provider / Api:**\nOnce you have created the chef service and have made sure a couple of cookbooks are uploaded. You can use chef with any other compute service in your system.\nIn the example above it will be used with EC2:\n\n    karaf@root()\u003e node-create --imageId eu-west-1/ami-c1aaabb5 --hardwareId m1.medium --adminAccess  karaf\n\n    [id]                 [location] [hardware] [group]   [status]\n    eu-west-1/i-bbb5eff0 eu-west-1c m1.medium  karafchef RUNNING\n\n    karaf@root()\u003e chef:node-bootstrap  eu-west-1/i-bbb5eff0 java::openjdk\n\nThe above can be also performed in a single step using the --recipe option:\n\n    karaf@root()\u003e node-create --imageId eu-west-1/ami-c1aaabb5 --hardwareId m1.medium --adminAccess --recipe chef/java::openjdk karaf\n\n\nUsing multiple services per provider/api\n----------------------------------------\n\nAs of jclouds-karaf 1.5.0 you are able to register multiple compute and blobstore services per provider or api. The commands will allow you to specify which service to use (just specifying provider/api isn't enough since we have multiple services).\nTo \"name\" the service, you can use the --name option in the service create commands. If no id is specified the provider/api name will be used instead.\n\nFor compute services:\n\n    jclouds:compute-service-create --name aws1 --provider aws-ec2 ...\n    jclouds:node-list --name aws1\n\n\nThis can be very useful when you want to configure either different accounts per provider/api or use different configuration options. A small example:\n\n    jclouds:compute-service-create --name aws-eu-west-1 --provider aws-ec2 --add-option jclouds.regions=eu-west-1\n    jclouds:compute-service-create --name aws-us-east-1 --provider aws-ec2 --add-option jclouds.regions=us-east-1\n\nThe available ids are now shown in the compute-service-list commands:\n\n    jclouds:compute-service-list\n\n    Compute Providers:\n    ------------------\n    [id]                     [type]       [service]\n    aws-ec2                  compute      [ aws-eu-west-1 aws-us-east-1 ]\n\n\nTo destroy one of the two available services:\n\n    jclouds:compute-service-destroy aws-us-east-1\n    jclouds:compute-service-list\n\n    Compute Providers:\n    ------------------\n    [id]                     [type]       [service]\n    aws-ec2                  compute      [ aws-eu-west-1 ]\n\n\nBlobstore services work in a very similar manner:\n\n    jclouds:blobstore-service-create --name s3-1 --provider aws-s3 ...\n\n\nUsing environmental variables\n-----------------------------\nWhen it comes to creating a service, you usually need to specify a provider/api, identity, credentials and endpoint. You can either\nspecify them using the command options as shown above, or pull them from your environment, if the corresponding environmental variables are found.\nSupported variables:\n\nFor Compute Services:\n\n* **JCLOUDS_COMPUTE_PROVIDER** The name of the compute provider.\n* **JCLOUDS_COMPUTE_API** The name of the compute api.\n* **JCLOUDS_COMPUTE_IDENTITY** The identity for accessing the compute provider.\n* **JCLOUDS_COMPUTE_CREDENTIAL** The credential for accessing the compute provider.\n* **JCLOUDS_COMPUTE_ENDPOINT** The endpoint (This is usually needed when using compute apis).\n* **JCLOUDS_USER** The username of that will be used for accessing compute instances.\n* **JCLOUDS_PASSWORD** The password that will be used for accessing compute instances.\n\nFor Blob Stores:\n\n* **JCLOUDS_BLOBSTORE_PROVIDER** The name of the blobstore provider.\n* **JCLOUDS_BLOBSTORE_API** The name of the blobstore api.\n* **JCLOUDS_BLOBSTORE_IDENTITY** The identity for accessing the blobstore provider.\n* **JCLOUDS_BLOBSTORE_CREDENTIAL** The credential for accessing the blobstore provider.\n* **JCLOUDS_BLOBSTORE_ENDPOINT** The endpoint (This is usually needed when using blobstore apis).\n\nFor Chef:\n\n* **JCLOUDS_CHEF_API** The name of the blobstore api.\n* **JCLOUDS_CHEF_CLIENT_NAME** The client name.\n* **JCLOUDS_CHEF_CLIENT_CREDENTIAL** The client credential.\n* **JCLOUDS_CHEF_CLIENT_KEY_FILE** The path of the client key file (can be used instead of the above).\n* **JCLOUDS_CHEF_VALIDATOR_NAME** The validator name.\n* **JCLOUDS_CHEF_VALIDATOR_CREDENTIAL** The validator credential.\n* **JCLOUDS_CHEF_VALIDATOR_KEY_FILE** The path of the validator key file (can be used instead of the above).\n* **JCLOUDS_CHEF_ENDPOINT** The endpoint (This is usually needed when using chef apis).\n\n\nConfiguring command output\n--------------------------\nAs of jclouds-karaf version 1.5.0-beta.11 jclouds-karaf commands support output customization. The customization features are:\n\n* **Width calculation** The commands calculate the required column width and adjust the format accordingly.\n* **Configurable columns** Can add remove columns using configuration.\n* **Groovy value retrieval** The display content is configurable using groovy expressions.\n* **Configurable column alignment** You can configure for each column left or right alignment.\n* **Configurable sorting options** Configure ordering by column using ascending or descending order.\n\nThe configuration for all columns can be found inside the org.jclouds.shell pid. Each configuration key is prefixed using the command category (node, image, location, hardware etc).\nThe suffix defines the configuration topic. For example hardware.headers defines the headers to be displayed by the hardware commands.\nIn the following commands the hardware category will be used as example.\n\n**Defining the command headers**\nTo specify the headers of a command we need to place to specify the headers configuration as a semicolon separated list.\nFor hardware:\n\n\n    hardware.headers=[id];[ram];[cpu];[cores]\n\n\n**Defining the display data**\nDisplay data are configured as a comma separated list of expressions (using the scripting engine of your choice, default is groovy). The expressions will be evaluated on the object of interest (in our example the hardware object).\nTo display the id field of the hardware object the expression to use is hardware.id. The reason for choosing groovy (as a default) for retrieving the data and not a simple expression language is that groovy is powerful and can be used for more complex expressions.\nFor example the Hardware object contains a collection of Processors and each processor has a filed of cores. To display the sum of cores among processors, we can use the following expression: hardware.processors.sum{it.cores}.\n\nYou can change the scripting engine:\n\n    hardware.engine=groovy\n\nPlease note that if you don't specify the engine, then groovy will be assumed.\n\nTo specify the display data, now all you need to do is to provide the expressions:\n\n    hardware.expressions=hardware.id;hardware.ram;hardware.processors.sum{it.cores*it.speed};hardware.processors.sum{it.cores}\n\nThe configuration above will display the hardware id in the first column, the hardware ram in the second column, the sum of cores X speed per processor in the third column and finally the sum of cores for all processors in the last column.\n\n**Defining the sort order**\nTo specify the sort column, the sortBy option can be used to point to the header of the column of interest.\nFor example hardware hardware.sortby=[cpu].\n\n**Changing the delimiter**\nMost of the configuration options for the shell table are passed as delimited strings. What happens when you want to change the delimiter?\nBy default the delimiter is the semicolon symbol, but for each command category you can specify the delimiter. For example:\n\n\n    hardware.delimiter=,\n    hardware.headers=[id],[ram],[cpu],[cores]\n\n\nUsing jclouds-karaf with the OBR features of Karaf\n--------------------------------------------------\nThere are cases were there are small discrepancies between the jclouds-karaf required bundles and the ones that are used in your project. Even though inside OSGi you can have multiple versions of a bundle, it often doesn't make sense for micro versions.\n\nTo avoid that you can install the obr feature of Karaf before installing jclouds-karaf. The obr feature among others provides the obr resolver, which will try to check if osgi package requirements are satisfied by existing bundles, before installing new bundles.\n\nFor example, assuming that a given version of jclouds-karaf is using jersey 1.11 and in your containers version 1.13 is already installed, the obr resolver will check if the 1.13 version can satisfy your needs and if so it will skip the installation of 1.11.\n\nCode completion\n---------------\n\nMost of the commands support tab completion, in order to help the user easily complete node ids, images, locations, blob containers etc.\n\n\n## License\n\nCopyright (C) 2009-2013 The Apache Software Foundation\n\nLicensed under the Apache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fkaraf-jclouds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fkaraf-jclouds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fkaraf-jclouds/lists"}