POST /projects/{projectName}/repos

<p>Creates a new repository.
195243
@Post("/projects/{projectName}/repos")
    @StatusCode(201)
    @ResponseConverter(CreateApiResponseConverter.class)
    @RequiresRole(roles = ProjectRole.OWNER)
    public CompletableFuture<RepositoryDto> createRepository(ServiceRequestContext ctx, Project project,
                                                             CreateRepositoryRequest request,
                                                             Author author) {
        if (Project.isReservedRepoName(request.name())) {
            return HttpApiUtil.throwResponse(ctx, HttpStatus.FORBIDDEN,
                                             "A reserved repository cannot be created.");
        }
        return execute(Command.createRepository(author, project.name(), request.name()))
                .thenCompose(unused -> mds.addRepo(author, project.name(), request.name()))
                .handle(returnOrThrow(() -> DtoConverter.convert(project.repos().get(request.name()))));
    }
395554
@Override
    public void addRemoteRepo(MavenRemoteRepository repository) {
        Builder builder = new Builder(repository.getId(), repository.getType(), repository.getUrl());
        builder.setPolicy(new RepositoryPolicy(true, repository.getUpdatePolicy() == null ? null : repository
                .getUpdatePolicy().apiValue(), repository.getChecksumPolicy() == null ? null : repository
                .getChecksumPolicy().apiValue()));

        for (RemoteRepository r : this.additionalRemoteRepositories) {
            if (r.getId().equals(repository.getId())) {
                this.additionalRemoteRepositories.remove(r);
            }
        }
        this.additionalRemoteRepositories.add(builder.build());
    }
754513
def _add_new_repo(repo, properties):
    '''
    
    '''
    repostr = '# ' if not properties.get('enabled') else ''
    repostr += 'src/gz ' if properties.get('compressed') else 'src '
    if ' ' in repo:
        repostr += '"' + repo + '" '
    else:
        repostr += repo + ' '
    repostr += properties.get('uri')
    repostr = _set_trusted_option_if_needed(repostr, properties.get('trusted'))
    repostr += '\n'
    conffile = os.path.join(OPKG_CONFDIR, repo + '.conf')

    with salt.utils.files.fopen(conffile, 'a') as fhandle:
        fhandle.write(salt.utils.stringutils.to_str(repostr))
1166778
def create_project(self, key, name, description=""):
        
        url = 'rest/api/1.0/projects'
        data = {"key": key,
                "name": name,
                "description": description
                }
        return self.post(url, data=data)
957490
function createRelease(version) {
      if(version) {
        releaseOptions.target_commitish = version;
      }
      github.repos.createRelease(releaseOptions, function() {
        nextRepo();
      });
    }
382121
private void addRepository(String repositoryId, RepositoryWrapper repositoryHolder) {
        repositories.put(repositoryId, repositoryHolder);
        try {
            numRepos = getNumberOfRepositories();
        } catch (WIMException e) {
            // okay
        }
    }
1139784
private function initializeRepositories(array $repositories): void
    {
        foreach ($repositories as $name => $data) {
            $this->repositories[$name] = new Repository($this, $name, $data);
        }
    }
51190
def createRepoObjects():
	""""""
	repositories = {}
	repodir = os.path.join(getScriptLocation())
	for importer, name, ispkg in pkgutil.iter_modules([repodir]):
		module = importer.find_module(name).load_module(name)
		repo_name = module.name
		if module.enabled:
			repositories[repo_name] = module.getRepository()
	
	return repositories
439289
def create_project(project, opts = {})
      data, _status_code, _headers = create_project_with_http_info(project, opts)
      return data
    end
1004677
public function createRepo(string $repo = null)
    {
        $end = $this->getVendorType() === 'org'
            ?'/orgs/' . $this->getVendor() . '/repos'
            : '/user/repos'
        ;
        $res = $this->request('POST', $end, [
            'name'        => $this->getName(),
            'description' => $this->getDescription(),
        ]);
        if (Helper::isResponseOk($res)) {
            echo "\ngit remote add origin git@github.com:{$this->getFullName()}.git\n";
            echo "git push -u origin master\n";
        }

        return $res;
    }
724283
def createrepositorytag(self, project_id, tag_name, ref, message=None):
        

        data = {'id': project_id, 'tag_name': tag_name, 'ref': ref, 'message': message}
        request = requests.post(
            '{0}/{1}/repository/tags'.format(self.projects_url, project_id), data=data,
            verify=self.verify_ssl, auth=self.auth, headers=self.headers, timeout=self.timeout)

        if request.status_code == 201:
            return request.json()
        else:
            return False
1318091
def add_repository(self, name, repository_type, repository_class,
                       aggregate_class, make_default, configuration):
        
        repo_mgr = self.get_registered_utility(IRepositoryManager)
        if name is None:
            # If no name was given, this is assumed to be the ROOT repository
            # for the given repository type.
            name = REPOSITORY_DOMAINS.ROOT
        repo = repo_mgr.new(repository_type, name=name,
                            make_default=make_default,
                            repository_class=repository_class,
                            aggregate_class=aggregate_class,
                            configuration=configuration)
        repo_mgr.set(repo)
1023636
public void addRepository(Repository repo) throws GreenPepperServerException
    {
        if (findRepositoryByName(repo.getName()) != null)
        {
            throw new GreenPepperServerException( GreenPepperServerErrorKey.REPOSITORY_ALREADY_EXISTS, "Repository already exists");
        }

        repo.setProject(this);
        repositories.add(repo);
    }
240488
def project_new(input_params={}, always_retry=False, **kwargs):
    
    return DXHTTPRequest('/project/new', input_params, always_retry=always_retry, **kwargs)
623144
def repo_clone(from_name, to_name)
      Dir.chdir(tmp_repos_path) { `git clone #{from_name} #{to_name} 2>&1 > /dev/null` }
      repo_path(to_name)
    end
954140
public CompletableFuture<Revision> restoreRepo(Author author, String projectName, String repoName) {
        requireNonNull(author, "author");
        requireNonNull(projectName, "projectName");
        requireNonNull(repoName, "repoName");

        final Change<JsonNode> change =
                Change.ofJsonPatch(METADATA_JSON,
                                   new RemoveOperation(JsonPointer.compile(
                                           "/repos" + encodeSegment(repoName) + "/removal")).toJsonNode());
        final String commitSummary = "Restore the repo '" + repoName + "' from the project " + projectName;
        return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
    }
272231
@RequirePOST
    @ValidateRepoName
    @RequireAdminRights
    @RespondWithRedirect
    public void doIgnore(@Nonnull @GHRepoName GitHubRepositoryName repo) {
        if (!ignored.contains(repo)) {
            ignored.add(repo);
        }
        resolveProblem(repo);
    }